﻿@font-face { font-family: 'KorolevLiUMedium'; src: url(https://ep.liu.se/webfonts/KorolevLiU-Medium.otf); font-display: swap }
@font-face { font-family: 'KorolevLiULight'; src: url(https://ep.liu.se/webfonts/korolevliu-light.woff); font-display: swap }

/* Basic CSS Reset */
/** { margin: 0; padding: 0; box-sizing: border-box; } */

html, body { height: 100%; margin: 0; }

/* Body Styling */
body { font-family: Georgia, sans-serif; padding: 0; }

.layout { display: flex; flex-direction: column; min-height: 100vh; }

/* Header Styling */
.header { background: #000; color: #fff; text-align: center; width: 100%; }

/* Main Content Styling */
.main { flex: 1; margin-bottom: 2rem; width: 100%; }

.main__grid { 
    display: grid; 
    grid-template-columns: 1fr minmax(auto, 800px) 1fr;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.main__ingress { font-family: KorolevLiULight, sans-serif; font-size: 1.3em; }
.main__title, .main__subtitle { font-family: KorolevLiUMedium, sans-serif; }
.main__section-title { font-family: KorolevLiULight, sans-serif; font-size: 1.3em; margin-top: 1em; margin-bottom: 0.3em; }

.main__center { padding: 1em; }

.main__content-paragraph { line-height: 1.3; }

.menu { background-color: rgba(255, 210, 0, 1); display: flex; flex-direction: row; justify-content: center; align-items: center; font-size: 1.3em; padding: 0.2em; }
.menu__item { margin: 0 1em 0 1em; font-family: KorolevLiULight; color: #fff; text-align: center; }
.menu__link { color: #000; font-weight: bold; text-decoration: none; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1em; margin-bottom: 1em; grid-column-gap: 1em; grid-row-gap: 1.5em; }
.grid3__cell { display: flex; justify-content: center; align-items: center; padding: 1em; border: solid 3px #000000; background-color: #FFD200; border-radius: 10px; }
.grid3__cell-title { margin: 0; }
.grid3__link { color: inherit; }
.grid3__cell--hover:hover { text-decoration: underline; cursor: pointer; }

.form__select { height: 1.5em; font-size: 1em; width: 40%; }
.form__select--small { width: 20%; }
.form__select--large { width: 80%; }

.search__results { margin-bottom: 4em; }

.results-header { display: grid; grid-template-columns: 5% auto 20% 20%; margin-top: 1em; margin-bottom: 1em; padding: 5px; grid-column-gap: 1em; background-color: #000; color: #fff; }

.results { display: grid; width: 100%; grid-template-columns: 5% auto 20% 20%; grid-gap: 5px; grid-column-gap: 1em; padding: 5px; border-bottom: dotted; border-bottom-color: lightgray; }
.results__cell--hover:hover { text-decoration: underline; cursor: pointer; }

.button { font-family: KorolevLiUMedium; background-color: #000; color: #fff; border: none; padding: 0.5em 1em; margin-top: 1em; cursor: pointer; border-radius: 5px; }
.button--hover:hover { text-decoration: underline; }

.form__label { margin-top: 1em; margin-bottom: 0.3em; font-size: 1.2em; display: block; clear: both; }
.form__input { height: 2em; padding-left: 0.3em; clear: both; box-sizing: border-box; }
.form__input--large { width: 80%; }

.content--top-padding { padding-top: 2em; }
.content--bottom-padding { padding-bottom: 3em; }
.content--center { padding-left: 25%; padding-right: 25%; }

.sidebar { background-color: #555; }
.sidebar__content { width: 100%; height: 100%; }

.list--bulleted { list-style-type: disc; margin-left: 2em; margin-top: 1em; margin-bottom: 1.5em; line-height: 1.3; }
.link--large { font-size: 1.3em; }

#Liu-logotype { height: 70px; width: auto; }
#svenska-kyrkan-logotype { height: 50px; width: auto; }

/* Autocomplete Suggestions Styling */
#kyrka-suggestions { position: absolute; z-index: 1000; max-width: 80%; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }

#kyrka-suggestions:not(:empty) {
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f0f8ff;
}

/* Footer Styling */
.footer { 
    background: #000; 
    color: #fff; 
    text-align: center; 
    width: 100%;
    padding: 2rem 0;
}

#label-cooperation {margin-bottom: -0.3rem;}

.footer__link { color: #fff; text-decoration: none; }

.footer__container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    gap: 2rem;
    align-items: start;
}

.margin--right { margin-right: 2em; }

.text--top { vertical-align: top; }

.link { text-decoration: none; }
.link--hover:hover { text-decoration: underline; }

.login-form__error { color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 10px; border-radius: 4px; margin-top: 15px; font-weight: bold; }

/*Table design*/
th.sortable { cursor: pointer; user-select: none; }
    th.sortable:hover { background: #e0e0e0; }

    th.sortable span { margin-left: 0.3em; font-size: 1em; color: #0078d4; }

.results-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 1rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

    .results-table thead tr { background-color: #f5f5f5; }

    .results-table th { padding: 0.75rem 1rem; border-bottom: 2px solid #e0e0e0; font-weight: 600; text-align: left; color: #333; }

        .results-table th.sortable { cursor: pointer; user-select: none; transition: background 0.2s; }

            .results-table th.sortable:hover { background: #e0e0e0; }

    .results-table tbody tr { transition: background 0.2s; }

        .results-table tbody tr:hover { background: #f0f8ff; }

    .results-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e0e0e0; color: #222; }

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #f5f5f5;
}

.details-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.details-list dt {
    font-weight: bold;
}

.details-list dd {
    margin: 0;
}

.details-actions {
    margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .main__grid,
    .footer__container { grid-template-columns: 1fr; }
        .main__grid > #col-left,
        .main__grid > #col-right { display: none; }
        .main__grid > #col-center { padding: 1em 0.5em; }
}

@media (max-width: 600px) {
    .header h1 { font-size: 1.5em; }
    .header h2 { font-size: 1em; }
    .footer__container { padding-bottom: 1em; grid-template-columns: 1fr; }
    .footer { font-size: 0.9em; padding: 1rem 0.5rem; }
    -footwe img {text-align: center;}
    .main { padding: 0; }
    .form__select { width: 100%; }
    .form__select--large { width: 100%; }
    .content--center { padding-left: 0.2em; padding-right: 0.2em; }
    
    #kyrka-suggestions {
        max-width: 95%;
    }

    .margin--right {margin-right: 0;}

    /* Stack detail labels above content on mobile */
    .details-list { grid-template-columns: 1fr; gap: 0.25rem; }

    .details-list dt {
        margin-top: 1rem;
        color: #666;
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .details-list dt:first-of-type {
        margin-top: 0;
    }

    .details-list dd {
        font-size: 1.1em;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e0e0e0;
    }

    /* Mobile-friendly table: Card layout */
    .results-table {
        width: 100%;
        box-shadow: none;
    }

    .results-table thead {
        display: none;
    }

    .results-table,
    .results-table tbody,
    .results-table tr,
    .results-table td {
        display: block;
    }

    .results-table tbody {
        width: 100%;
    }

    .results-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 0.75rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        width: 100%;
        box-sizing: border-box;
    }

    .results-table td {
        padding: 0.5rem 0;
        border-bottom: none;
        text-align: left;
        display: grid;
        grid-template-columns: 100px 1fr;
        gap: 0.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 100%;
        box-sizing: border-box;
    }

    .results-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #333;
    }

    .results-table td:last-child {
        border-bottom: none;
    }

    .clickable-row:hover {
        background-color: #f0f8ff;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
}
