@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('/css/search-form.css');

/* Reset */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --TEXT-PRIMARY-COLOR: #212121;
    --TEXT-SECONDARY-COLOR: #fff;
    
    --BODY-MARGIN-BG-COLOR: #4e5374;
    --BG-COLOR: #fff;

    --HEADER-BG-COLOR: #6470c2;
    --MENU-BG-COLOR: #263238;

    --FOOTER-COLOR: #fff;
    --FOOTER-BG-COLOR:#3e4986;

    --LINK-COLOR: #1565c0;
    --EMPHASIS-COLOR: #FFEB3B;
    --PRIMARY-COLOR: #1565c0;
    --SECONDARY-COLOR: #263238;
    --OUTLINE-COLOR: #d3d339;
    --SELECTION-COLOR: #9C27B0;
}

::selection {
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--SELECTION-COLOR);
}

:focus {
    outline-offset: 1px;
    outline-style: solid;
    outline-width: 2px;
    outline-color: var(--OUTLINE-COLOR);
}

/* width */
::-webkit-scrollbar {
    width: 16px;
}

/* Track */
::-webkit-scrollbar-track-piece {
    background-color: rgb(0 0 0 / 10%);
    backdrop-filter: blur(3px);
    /* Adding border and/or radius causes the track to look splitted into 2 pieces with borders applied on both
    border: solid 1px rgb(0 0 0 / 20%);
    border-radius: 8px; */
}

/* Handle */
::-webkit-scrollbar-thumb {
    background-color: rgb(255 255 255 / 20%);
    border-radius: 8px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background-color: rgb(255 255 255 / 50%);
}

/* Make sure placeholders displayed in the correct direction when element's dir attribute set to auto */
:placeholder-shown {
    direction: inherit;
}

::placeholder {
    color: #757575;
    opacity: 1;
}

::-webkit-calendar-picker-indicator {
    color-scheme: dark;
}

html {
    min-height: 100vh;
    scroll-behavior: smooth;
    scroll-padding-block: 100px;
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-size: 16px;
    background-color: var(--BODY-MARGIN-BG-COLOR);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* expand the body to cover all viewport height */
    max-width: 1440px;
    margin: auto;
    color: var(--TEXT-PRIMARY-COLOR);
    background-color: var(--BG-COLOR);
}

body.no-scroll {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
}

h1 {
    font-size: 1.5rem;
}

section {
    padding: 20px 0;
}

a {
    color: var(--LINK-COLOR);
}

b {
    font-weight: 600;
}

em {
    color: var(--EMPHASIS-COLOR);
}

hr {
    margin: 0 auto 1rem auto;
    border: inset 1px #546e7a;
}

.loading {
    display: inline-block;
    position: absolute;
    padding: 5px 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 4px;
    color: #fff;
    background-color: rgb(0 0 0 / 80%);
    line-height: 1;
    white-space: nowrap;
    z-index: 100;
}

.loading i {
    display: inline-block;
    vertical-align: middle;
    animation: spin infinite linear .4s;
}

@keyframes spin {
    from {
        rotate: 0deg;
    }

    to {
        rotate: 180deg;
    }   
}

/* Main Nav */
.main-nav {
    flex-grow: 1;
    font-size: .9rem;
}

.main-nav .menu {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 10px;
    height: 100%;
    list-style: none;
}

.main-nav .sub-menu {
    display: none;
    list-style: none;
    text-align: end;
    z-index: 1;
}

.main-nav .menu i {
    margin-inline-end: 4px;
    padding: 2px;
    font-size: 1rem;
    vertical-align: middle;
}

.main-nav .menu li:focus-within .sub-menu {
    display: block;
}

.main-nav a {
    display: inline-block;
    padding: 8px 10px;
    width: 100%;
    color: inherit;
    border-radius: 2px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: color .3s, background-color .3s;
}

.main-nav a:hover {
    background-color: var(--MENU-BG-COLOR);
}

.main-nav a:active {
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--HEADER-BG-COLOR);
}

.main-nav a.selected {
    color: #fafafa;
    background-color: var(--PRIMARY-COLOR);
}

.maintenance-mode {
    position: fixed;
    top: 0;
    padding: 0.5rem 1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
    color: #fff;
    background-color: #F44336;
    font-size: smaller;
    white-space: nowrap;
    z-index: 2000;
}

.overlay {
    border-image: fill 0 linear-gradient(#0000, #000D);
}

/* GDPR */
.gdpr-consent {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    color: #fff;
    background-color: rgba(0, 0, 0, .8);
    backdrop-filter: blur(3px);
}

.gdpr-consent button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    color: #000;
    background-color: #FDD835;
    font: inherit;
    cursor: pointer;
}

/* Footer */
footer.main-footer {
    padding: 1rem;
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--FOOTER-BG-COLOR);
    text-align: center;
    font-size: smaller;
    line-height: 1.4;
}

footer.main-footer a {
    color: var(--EMPHASIS-COLOR);
}

.main-footer .last-update {
    margin-top: 0.5rem;
}


/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 10px;
    right: 5px;
    width: 90%;
    max-width: 400px;
    padding: 10px 40px 10px 10px;
    margin: auto;
    transform: translateX(calc(100% + 5px));
    border-radius: 6px;
    border: solid 1px #212121;
    border-left-width: 10px;
    line-height: 1.5;
    color: #212121;
    background-color: #fff;
    box-shadow: 2px 4px 10px #212121;
    z-index: 2000;
    transition: transform .3s;
}

.toast-message.show {
    transform: translateX(0);
}

.toast-message .close {
    display: inline-block;
    position: absolute;
    width: 24px;
    height: 24px;
    top: 5px;
    right: 5px;
    border-radius: 50%;
    line-height: 24px;
    color: #fff;
    background-color: #212121;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

.toast-message.exception,
.toast-message.reference_error,
.toast-message.error {
    border-color: #ff5722;
}

.toast-message.info {
    border-color: #0277bd;
}

.toast-message.warning,
.toast-message.validation_error {
    border-color: #ffc900;
}

.toast-message.success {
    border-color: #93c34b ;
}

/* --------------- Main layout --------------- */
header.main-header {
    display: flex;
    position: sticky;
    top: 0;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--HEADER-BG-COLOR);
    box-shadow: #000 0 0 15px;
    z-index: 3;
}

header.main-header a {
    color: inherit;
    text-decoration: none;
}

header.main-header .logo {
    flex-grow: 1;
    display: inline-block;
    font-size: 1.6rem;
}

header.main-header .emergency {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--EMPHASIS-COLOR);
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: nowrap;
}

header.main-header .logo img {
    height: 60px;
    vertical-align: middle;
}

@media (max-width: 700px){
    header.main-header .logo {
        display: inline-block;
        width: 60px;
        overflow: hidden;
    }
    
    header .website-name {
        display: none;
    }
}
@media (max-width: 510px){
    header.main-header .emergency {
        position: absolute;
        top: 10px;
        right: 20px;
        flex-direction: row;
        gap: 15px;
    }

    header.main-header .main-nav {
        align-self: end;
    }
    header.main-header .main-nav .menu {
        gap: 0;
    }
}

@media (max-width: 390px){
    header.main-header .emergency > :first-child {
        display: none;
    }
}

.main-layout main {
    flex-grow: 1;
}


/* --------------- Blank layout --------------- */

/* Error view */
.blank-layout.error-view {
    color: #9e9e9e;
}

.blank-layout.error-view main {
    flex-grow: 1;
    display: flex;
}

.blank-layout.error-view .container {
    margin: auto;
    max-width: 95%;
    text-align: center;
}


.blank-layout.error-view h1,
.blank-layout.error-view h2 {
    margin-bottom: 1rem;
    font-weight: lighter;
}

/* Home view */
.home-view .hero {
    background: url(/img/hero.jpg) no-repeat center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--TEXT-SECONDARY-COLOR);
}

.home-view .hero .hero-container {
    padding: 40px 10px;
    text-align: center;
    text-shadow: #000 0 0 5px, #000 0 0 5px, #000 0 0 5px
}

.home-view .hero img {
    height: 150px;
    filter: drop-shadow(0 0 8px #fff);
}

.home-view .hero h1 {
    margin: .5rem 0;
    font-size: 1.7rem;
    font-weight: 600;
}

.home-view .services {
    margin: 40px 0 0;
}

.home-view .services h2 ,
.home-view .services h3 {
    text-align: center;
    font-size: 1.7rem;
}

.home-view .services .service-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
}

.home-view .services .service-container article {
    flex-basis: 30%;
    flex-grow: 1;
    text-wrap: pretty;
    text-align: center;
    padding: 20px;
    min-width: 235px;
    border-radius: 4px;
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--HEADER-BG-COLOR);
    line-height: 1.3;
    transition: scale .2s, box-shadow .2s;
}

.home-view .services .service-container article:focus ,
.home-view .services .service-container article:hover {
    scale: 1.05;
    box-shadow: #000 0 0 10px;
}

.home-view .services .service-container article i {
    font-size: 3rem;
}

.home-view .services .service-container article p {
    margin-top: 1rem;
    text-align: left;
}


.home-view .about h2 {
    text-align: center;
    font-size: 1.7rem;
}

.home-view .about .about-container {
    display: flex;
    margin: 20px 0;
    padding: 0;
    justify-content: space-between;
    flex-wrap: wrap-reverse;
}

.home-view .about .about-container > * {
    flex-basis: 50%;
    flex-grow: 1;
    min-height: 200px;
    color: var(--TEXT-SECONDARY-COLOR);
}

.home-view .about .left-section {
    display: grid;
    place-content: center start;
    position: relative;
    background-color: #4aa1dd;
}

.home-view .about .left-section p {
    position: relative;
    left: 30px;
    font-size: 1.7rem;
}

.home-view .about .left-section .arc {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.home-view .about .right-section {
    background: url("/img/about.jpg") no-repeat center bottom;
    background-size: cover;
    background-attachment: fixed;
    text-align: center;
}

.home-view .about .right-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 3rem 3rem;
    gap: 20px;
    padding: 60px 4vw;
    font-size: 0.8rem;
}

.home-view .about .right-section .container p {
    align-content: center;
    padding: 10px;
    border-radius: 4px;
    background-color: #3a3c3b;
    transition: scale .2s, box-shadow .2s;
}

.home-view .about .right-section .container p:focus ,
.home-view .about .right-section .container p:hover {
    scale: 1.05;
    box-shadow: #000 0 0 10px;
}

.home-view .contacts {
    padding: 0;
}

.home-view .contacts h2 {
    text-align: center;
    font-size: 1.7rem;
}

.home-view .contacts .contacts-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px 20px;
    margin: 20px 0 0;
    padding: 20px;
    background-color: var(--HEADER-BG-COLOR);
    color: var(--TEXT-SECONDARY-COLOR);
}

.home-view .contacts address {
    flex-basis: fit-content;
    min-width: 160px;
    font-style: normal;
}

.home-view .contacts h3 {
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.home-view .contacts p {
    padding: 5px;
}

.home-view .contacts a {
    color: inherit;
    text-decoration: none;
    text-underline-offset: 5px;
}

.home-view .contacts a:hover ,
.home-view .contacts a:focus {
    text-decoration: underline;
}

/* Search view */
.search-view .search {
    background: url(/img/hero.jpg) no-repeat center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--TEXT-SECONDARY-COLOR);
}

.search-view .search-result {
    margin: 0 10px;
}

.search-view h1 {
    margin: .5rem 0;
    font-size: 1.7rem;
    font-weight: 600;
}    

.search-view .search-note {
    color: var(--TEXT-SECONDARY-COLOR);
    background-color: var(--PRIMARY-COLOR);
    padding: 10px;
    border-radius: 4px;
    line-height: 1.5;
    font-style: italic;
    font-size: smaller;
}

.search-view .result-container {
    position: relative;
    margin: 20px 0;
}

.search-view .result-item {
    margin: 10px 0;
    padding: 10px;
}

.search-view .result-item:nth-child(even) {
    background-color: #EEEEEE;
}

.search-view .result-item summary {
    padding: 10px 0;
    cursor: pointer;
}

.search-view .result-item summary .hint {
    margin: 5px 0 0 5px;
    color: #757575;
    font-size: .6em;
    font-style: italic;
}

.search-view .result-item summary::marker {
    content: '';
}

.search-view .result-item summary i {
    display: inline-block;
    transition: transform .2s;
}

.search-view .result-item details[open] summary i {
    transform: rotate(90deg);
}

.search-view .result-item .close {
    display: none;
}

.search-view .result-item img {
    display: block;
    margin: 20px auto;
    padding: 10px;
    max-width: 100%;
    max-height: 450px;
    border: 4px solid #EEEEEE;
    border-radius: 8px;
    box-shadow: #ccc 0 0 15px;
    outline: none;
}

.search-view .result-item img.maximize {
    cursor: pointer;
}

.search-view .result-item img.maximize:hover {
    outline: 4px dashed var(--SELECTION-COLOR);
}

.search-view .result-item img.maximize:focus {
    position: fixed;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    top: 0;
    left: 0;
    border: none;
    border-radius: 0;
    object-fit: contain;
    z-index: 3;
    box-shadow: none;
    backdrop-filter: blur(3px);
    background-color: rgb(0 0 0 / 80%);
}

.search-view .result-item img.maximize:focus + .close {
    display: inline-block;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    border-radius: 50%;
    color: #fff;
    background-color: #F44336;
    z-index: 4;
    cursor: pointer;
}

.search-view .result-item .close:focus ,
.search-view .result-item .close:hover {

}

.search-view .vessel-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    line-height: 1.5;
}

.search-view .vessel-details li {
    list-style: none;
}

.search-view label {
    display: block;
    font-weight: 700;
}

.search-view .policy-type {
    margin: 1rem 0;
}

.search-view .policy-type ul {
    margin: 0.5rem 0.5rem;
    list-style: inside square;
    line-height: 1.5;
}

.search-view .no-result-found {
    margin: auto;
    padding: 10px;
    max-width: 300px;
    border-radius: 4px;
    background-color: #fdd835;
    text-align: center;
    font-size: 1.5rem;
}

.search-view .results-found {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    background-color: #C8E6C9;
}

@media (max-width: 700px) {
    .search-view .vessel-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .search-view .vessel-details {
        grid-template-columns:1fr;
    }

    .search-view label {
        display: inline-block;
        margin-right: 1rem;
    }
}