
/* style.css * Ver 1.01*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
}
.page {
    display: none; /* Gömmer alla sidor som standard */
}

.page.active {
    display: block; /* Visar bara den som har klassen 'active' */
    animation: fadeIn 0.3s ease-in-out; /* Valfritt: mjuk in-toning */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
.card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    margin-bottom: 1.5rem;
}
/* Justerad padding för att minska menyns höjd */
.nav-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.nav-link.active {
    border-bottom: 2px solid #1e40af;
}
/* Modal-styling för felmeddelanden och bekräftelse */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 0.75rem;
    width: 80%;
    max-width: 500px;
    text-align: center;
}
.modal-close-btn {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
/* Style för den enkla redigeraren */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap; /* Gör att knapparna kan radbrytas på små skärmar */
}
.editor-toolbar button {
    transition: background-color 0.2s;
}
.editor-toolbar .active {
    background-color: #cbd5e1; /* Tailwind 'slate-300' för aktiv knapp */
}
.editor-content {
    min-height: 150px;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    outline: none;
}
/* Stilar för Markdown-innehåll */
.markdown-content p {
    margin-bottom: 1rem;
}
.markdown-content a {
    color: #2563eb;
    text-decoration: underline;
}
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 1rem;
    margin-bottom: 1rem;
}
/* Kalenderpost-styling för klickbarhet */
.calendar-post {
    cursor: pointer;
}
.calendar-post-expanded {
    display: block;
}
.gallery-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
}
/* Specialklass för större logo-storlek */
.logo-large {
    height: 150px;
    width: 150px;
}
/* Flex-box-layout för sponsorer */
.sponsors-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
    margin-bottom: 24px;
}
.sponsors-grid-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sponsor-card-1-1 {
    width: 100%;
    max-width: 100%;
    flex: 1 0 100%;
    padding: 2rem;
}

.sponsor-card-1-2 {
    width: calc(50% - 12px);
    max-width: 600px;
    flex: 1 0 calc(50% - 12px);
}

.sponsor-card-1-4 {
    width: calc(25% - 18px);
    max-width: 300px;
    flex: 1 0 calc(25% - 18px);
}

.sponsor-logo {
    max-height: 100px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.sponsor-card-1-1 .sponsor-logo {
    max-height: 150px;
}
.sponsor-card-1-2 .sponsor-logo {
    max-height: 120px;
}
.sponsor-card-1-4 .sponsor-logo {
    max-height: 90px;
}
/* Åtgärdat färg-input */
#header-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}
#header-color-input::-webkit-color-swatch {
    border: none;
}
#header-color-input {
    height: 48px; /* Standardstorlek för input-fält */
}

/* Responsiv design */
@media (max-width: 768px) {
    .sponsor-card-1-2, .sponsor-card-1-4 {
        width: 100%;
        flex: 1 0 100%;
        max-width: none;
    }
    .logo-large {
        height: 75px;
        width: 75px;
    }
    .page h1, .page h2 {
        font-size: 1.5rem;
    }
    .nav-link {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    #site-logo-link {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    #site-title-display {
        font-size: 2rem;
    }
    #admin-indicator {
        top: 0.5rem;
        right: 0.5rem;
    }
    /* Gör nav-menyn scrollbar på små skärmar */
    nav {
        overflow-x: auto;
    }
    nav ul {
        display: inline-flex;
        white-space: nowrap;
    }
}
/* Bildstorlekar för Nyheter/Editor */
img.img-small {
    width: 30%;
    min-width: 150px;
    float: left;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

img.img-medium {
    display: block;
    width: 70%;
    margin: 1rem auto; /* Centrera */
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

img.img-large {
    display: block;
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
}

/* Fix för att innehåll inte ska "fastna" bredvid flytande bilder om texten är kort */
.editor-content::after {
    content: "";
    display: table;
    clear: both;
}
/* Bildväljaren */
.gallery-selection-item {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.gallery-selection-item:hover {
    transform: scale(1.05);
    border-color: #2563eb; /* Blue-600 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.gallery-selection-item img {
    width: 100%;
    height: 100px; /* Fast höjd för snyggt rutnät */
    object-fit: cover;
}

.gallery-selection-item p {
    font-size: 0.7rem;
    padding: 2px 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
