/* ============================================
   MODERNE RESPONSIV CSS FOR BILSPORTBIBLIOTEKET
   Optimalisert for mobil, tablet og desktop
   Kompakt design med minimal luft
   ============================================ */

/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background-color: #f0f0f0;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    font-size: clamp(22px, 4vw, 26px);
    text-align: center;
    color: #002652;
    margin: 10px 0 15px 0;
    font-weight: 700;
}

h2 {
    font-size: clamp(18px, 3.5vw, 22px);
    color: #002652;
    border-bottom: 2px solid #002652;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

h3 {
    font-size: clamp(15px, 3vw, 17px);
    background-color: #002652;
    color: #eaeaea;
    padding: 6px 10px;
    margin: 0 0 8px 0;
    border-bottom: 2px solid #eaeaea;
    font-weight: 600;
}

p {
    font-size: clamp(13px, 2.5vw, 15px);
    color: #333;
    line-height: 1.5;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header-container {
    background-color: #002652;
    padding: 6px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
    min-height: 42px;
}

.header-left {
    flex-shrink: 0;
}

.header-left img {
    height: 30px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-container img {
    height: 32px;
    max-width: 100%;
}

/* Søkemotor i header */
.header-search-form {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
}

.header-search-input {
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    outline: none;
    width: 200px;
    min-width: 0;
}

.header-search-btn {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    background-color: #0066cc;
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.header-search-btn:hover {
    background-color: #0052a3;
}

/* Mobilsøk under header */
.header-search-mobile {
    display: none;
    background-color: #002652;
    padding: 0 15px 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-search-mobile-form {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.header-search-mobile-form .header-search-input {
    flex: 1;
    width: auto;
    padding: 10px 12px;
    font-size: 15px;
}

.header-search-mobile-form .header-search-btn {
    padding: 10px 18px;
    font-size: 15px;
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dotted #eaeaea;
    background-color: #002652;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.menu {max-width:800px; margin:0 auto; width:100%;}

.menu-buttons {
    display: flex;
    flex-wrap: wrap;
}

.menu-button {
    text-decoration: none;
    color: #eaeaea;
    padding: 8px 15px;
    font-size: clamp(13px, 2vw, 15px);
    background-color: #002652;
    transition: all 0.3s ease;
    font-weight: 700;
    border-right: 1px dotted #eaeaea;
    white-space: nowrap;
}

.menu-button:first-child {
    border-left: 1px dotted #eaeaea;
}

.menu-button:hover {
    background-color: #eaeaea;
    color: #002652;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   MOBILE HEADER IMPROVEMENTS
   ============================================ */
/* Fullskjerm mobilmeny (skjult som default) */
.mobile-menu {
    display: none;                 /* vises først når .active */
    position: fixed;
    /* i stedet for inset:0 og height:100vh: */
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: auto;                  /* ← viktig */
    width: auto;
    height: auto;                  /* ← viktig: størrelse styres av innholdet */
    max-height: calc(100vh - 24px);/* stoppar før skjermkanten hvis mange punkter */
    background: #002652;
    overflow-y: auto;
    z-index: 10000;
    padding: 12px 12px 24px;
    border-radius: 12px;           /* pen “kort”-følelse */
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Topp i mobilmenyen (logo + lukk) */
.mobile-menu-header {
    position: sticky;
    top: 0;
    background: #002652;
    padding: 8px 36px 8px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dotted #eaeaea;
    z-index: 10001;
}
.mobile-menu-header img {
    height: 24px;
    width: auto;
}

/* Menypunkter inne i mobilmenyen */
.mobile-menu .menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
}
.mobile-menu .menu-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px dotted #eaeaea;
    background: transparent;
}
/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 15px;
    z-index: 999;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #eaeaea;
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .header-left img {
        height: 22px;
    }
}

/* Mobile Navigation Menu - Close Button */
.menu-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #eaeaea;
    cursor: pointer;
    z-index: 10002;
    line-height: 1;
    display: block;               /* ← vises alltid i mobilmenyen */
}

/* Mobile Search Improvements */
.search-form-mobile {
    display: none;
    padding: 10px;
    background-color: #002652;
    align-items: center;
}

.search-form-mobile .search-input {
    flex: 1;
    padding: 8px 12px;
    height: auto;
    font-size: 16px;
    margin: 0 10px 0 0;
}

.search-form-mobile .search-button {
    width: auto;
    height: auto;
    padding: 8px 15px;
    font-size: 16px;
}

.mobile-menu.active {
    display: block;
}

/* When menu is open */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Media Queries */
@media (max-width: 640px) {
    .hamburger-menu {
        display: flex;
    }

    .header-container {
        position: relative;
        padding: 12px 15px;
    }

    .header-search-form {
        display: none;
    }

    .header-search-mobile {
        display: flex;
    }

    .top-bar-container {
        display: none;
    }

    .menu-close {
        display: block;
    }

    .mobile-menu.active {
        display: block;
    }
}

/* ============================================
   SEARCH
   ============================================ */
.search-form {
    display: flex;
    align-items: center;
    padding: 5px 10px;
}

.search-form-mobile {
    display: none;
}

.search-input {
    padding: 7px 12px;
    font-size: clamp(13px, 2vw, 15px);
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 200px;
    margin-right: 8px;
}

.search-button {
    padding: 7px 15px;
    font-size: clamp(13px, 2vw, 15px);
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #0052a3;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.container,
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 0;
}

.container:first-of-type {
    margin-top: 6px;
}


/* ============================================
   DRIVER PAGE LAYOUT
   ============================================ */
.driver-layout-wrapper {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
}

.driver-sidebar,
.driver-main-content,
.driver-ad-content {
    width: 100%;
    padding: 10px;
}

.driver-ad-content {
    display: none;
}

/* ============================================
   FLEX CONTAINERS
   ============================================ */
.flex-container,
.flex-container2 {
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.flex-item {
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
}

.flex-item2 {
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
}

.flex-item2 a {
color:#eaeaea!important;
}

.flex-item h3 {
    font-size: clamp(14px, 2.5vw, 16px);
    margin: 0;
    padding: 5px 10px;
}

.flex-item h1 {
    margin: 10px 0 9px 0;
    line-height: 1;
}

.flex-item p {
line-height: 0.8;
}
.flex-item-overview {
    background-color: #002652;
    color: #eaeaea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

/* ============================================
   PROFILE & IMAGES
   ============================================ */
.spesifikt-bilde {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px auto;
}

/* ============================================
   BOXES & BUTTONS
   ============================================ */
.box,
.box-award {
    background-color: #002652;
    color: #eaeaea;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
    margin: 3px;
    display: inline-block;
    text-align: center;
    font-size: clamp(13px, 2.5vw, 15px);
    font-weight: 600;
    cursor: pointer;
}

.box:hover,
.box-award:hover {
    background-color: #eaeaea;
    color: #002652;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.stats-menu {
    background-color: #002652;
    color: #eaeaea;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
    margin: 2px;
    display: inline-block;
    text-align: center;
    font-size: clamp(12px, 2vw, 13px);
    font-weight: 700;
    min-width: 70px;
}

.stats-menu:hover {
    background-color: #eaeaea;
    color: #002652;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   CHAMPIONS & DISCIPLINES
   ============================================ */
.discipline-title {
    background-color: #ffffff;
    padding: 10px;
    margin: 0;
    color: #002652;
    text-align: center;
    font-weight: 700;
    font-size: clamp(20px, 4vw, 26px);
    border: 1px dotted #002652;
}

.champions-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px 10px;
    background-color: #ffffff;
}

.champion {
    background-color: #eaeaea;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.year-title {
    background-color: #003565;
    color: #eaeaea;
    margin: 0;
    padding: 8px;
    text-align: center;
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 700;
}

.year-title a {
    color: #eaeaea;
    text-decoration: none;
}

.year-title a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ============================================
   AWARDS GRID
   ============================================ */
.awards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px 0;
    padding: 0 10px;
}

.award-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.award-title {
    background: #002652;
    color: white;
    padding: 8px;
    margin: 0;
    font-size: clamp(15px, 3vw, 18px);
    text-align: center;
    font-weight: 700;
}

.award-table {
    width: 100%;
    border-collapse: collapse;
}

.award-table thead {
    background: #f5f5f5;
}

.award-table th {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    font-size: clamp(13px, 2.5vw, 15px);
}

.award-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    font-size: clamp(13px, 2.5vw, 15px);
}

.award-table tbody tr:hover {
    background: #f9f9f9;
}

.award-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.award-table a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.award-table a:hover {
    text-decoration: underline;
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    font-size: clamp(12px, 2.5vw, 13px);
}

table td,
table th {
    padding: 5px 8px;
    border: none;
    line-height: 1.3;
}

table tr:nth-child(odd) {
    background-color: #f5f5f5;
}

table tr:nth-child(even) {
    background-color: #ffffff;
}

.champions-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.champions-table thead {
    background-color: #002652;
}

.champions-table th {
    background-color: #002652;
    color: #eaeaea;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: clamp(13px, 2.5vw, 15px);
}

.champions-table td {
    padding: 5px 8px;
    text-align: left;
    vertical-align: top;
    font-size: clamp(13px, 2.5vw, 15px);
}

.champions-table tr {
    border-bottom: 1px solid #d1d1d1;
}

.champions-table tr:nth-child(odd) {
    background-color: #ffffff;
}

.champions-table tr:nth-child(even) {
    background-color: #f5f5f5;
}

.champions-table tbody tr:hover {
    background-color: #f0f0f0;
}

.champions-table a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.champions-table a:hover {
    text-decoration: underline;
}

/* Column widths */
.champions-table th:nth-child(1),
.champions-table td:nth-child(1) {
    width: 42.5%;
}

.champions-table th:nth-child(2),
.champions-table td:nth-child(2) {
    width: 15%;
    text-align: center;
}

.champions-table th:nth-child(3),
.champions-table td:nth-child(3) {
    width: 42.5%;
}

/* ============================================
   RESULTS TABLES
   ============================================ */
.results-container {
    width: 100%;
    margin: 0 auto;
}

.results-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1.5fr 1.5fr;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    padding: 3px 8px;
}

.results-row.header {
    background-color: #002652;
    color: #fff;
    font-weight: bold;
    padding: 6px 8px;
}

.results-item {
    font-size: clamp(12px, 2.5vw, 16px);
}

.year-header {
background-color: #002652;
    color: #fff;
    padding: 2px 6px;
    text-align: left;
    font-weight: bold;
    font-size: clamp(14px, 3vw, 16px);
    margin-top: 8px;
}

.year-header a {
    color: #eaeaea;
    text-decoration: none;
}

.year-header a:hover {
    color: #fff;
    text-decoration: underline;
}

.status-sup { display: none; }


/* Desktop som default: vis status-kolonne, skjul inline-parentes */
.status-inline { display: none; }
.status-col { display: block; }

/* ============================================
   CATEGORY SECTIONS
   ============================================ */
.category-container {
    width: 100%;
    background-color: #fff;
    padding: 12px;
    margin-bottom: 15px;
}

.category-container h2 {
    font-size: clamp(18px, 4vw, 24px);
    color: #002652;
    text-align: left;
    margin: 0 0 12px 0;
    border-bottom: 2px solid #002652;
    padding-bottom: 6px;
}

.category-container.birthday,
.category-container.death {
    background-color: #fff;
    padding: 12px;
    margin-bottom: 8px;
    font-size: clamp(13px, 2.5vw, 15px);
    color: #333;
}

.category-section {
    max-width:800px;
    margin:0 auto;
    padding-top: 10px;
}

.category-section h2 {
margin-bottom:0px;
}

/* ============================================
   RANDOM PROFILES
   ============================================ */
.random-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.profile-link {
    text-decoration: none;
    display: block;
}

.profile-box {
    background-color: #002652;
    border: 3px solid #fff;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
}

.profile-box:hover {
    background-color: #eaeaea;
    border-color: #002652;
}

.profile-box img {
    width: 100%;
    height: auto;
    display: block;
}

.profile-name {
    font-size: clamp(13px, 2.5vw, 16px);
    font-weight: 700;
    line-height: 1.2;
    padding: 7px 6px;
    color: #eaeaea;
    text-align: center;
}

.profile-box:hover .profile-name {
    color: #002652;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
}

.search-result {
    width: 100%;
    max-width: 600px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-result:hover {
    background-color: #eaeaea;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.profile-image {
    width: 90px;
    height: auto;
    margin-right: 12px;
    border-radius: 3px;
}

.info-column {
    flex: 1;
}

.search-result h3 {
    background: none;
    color: #002652;
    padding: 0;
    margin: 0 0 4px 0;
    border: none;
    font-size: clamp(15px, 3vw, 18px);
}

.search-result p {
    margin: 2px 0;
    font-size: clamp(12px, 2.5vw, 14px);
}

.search-result a {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   LINKS
   ============================================ */
a {
    color: #0066cc;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline;
    color: #0052a3;
}

/* ============================================
   YEAR LINKS
   ============================================ */
.year-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.year-link {
    background-color: #002652;
    color: #eaeaea;
    font-size: clamp(15px, 3vw, 18px);
    padding: 7px 12px;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.year-link:hover {
    background-color: #eaeaea;
    color: #002652;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    max-width: 1200px;
    margin: 15px auto 0;
    background-color: #fff;
    padding: 15px;
    font-size: clamp(11px, 2vw, 13px);
    text-align: center;
    color: #666;
}

/* ============================================
   RESPONSIVE - TABLET (641px - 980px)
   ============================================ */
@media (min-width: 641px) and (max-width: 980px) {
    .champions-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .awards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .random-profiles {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   RESPONSIVE - DESKTOP (981px+)
   ============================================ */
@media (min-width: 981px) {
    .search-form-mobile {
        display: none;
    }
    
    .driver-layout-wrapper {
        display: flex;
    }
    
    .driver-sidebar {
        width: 25%;
        flex-shrink: 0;
    }
    
    .driver-main-content {
        width: 75%;
        flex-grow: 1;
    }
    
    .driver-sidebar .flex-item {
        width: 100%;
        margin: 0 0 10px 0;
        padding: 10px 10px 1px 10px;
    }
    
    .champions-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .awards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .random-profiles {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max 640px)
   ============================================ */
@media (max-width: 640px) {
    .search-form {
        display: none;
    }

    .spesifikt-bilde {
    max-width: 60%;
}
    
    .search-form-mobile {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 12px;
        background-color: #002652;
        gap: 8px;
    }
    
    .search-form-mobile .search-input {
        width: 100%;
        max-width: 380px;
        padding: 12px;
        font-size: 15px;
    }
    
    .search-form-mobile .search-button {
        width: 100%;
        max-width: 180px;
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .header-container {
        flex-direction: column;
        padding: 12px;
    }
    
    .header-container img {
        height: 45px;
    }
    
    .menu-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .menu-button {
        width: 100%;
        text-align: center;
        padding: 12px;
        border: none;
        border-bottom: 1px dotted #eaeaea;
    }
    
    .champions-container,
    .awards-grid {
        grid-template-columns: 1fr;
        padding: 8px;
    }
    
    .random-profiles {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .search-result {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-image {
        margin: 0 0 8px 0;
        width: 130px;
    }
    
  /* 3 kolonner: Gren (smal), Klasse (bred), Resultat */
  .results-row {
    display: grid;
    grid-template-columns: 0.9fr 2.4fr 1fr; /* juster evt. 0.8fr / 2.5fr / 1fr */
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
  }

  /* Header-raden følger samme 3-kol layout */
  .results-row.header {
    grid-template-columns: 0.9fr 2.4fr 1fr;
    padding: 6px 8px;
  }

  /* Skjul hele status-kolonnen (både header og rader) */
  .results-row .results-item.status,
  .results-row .results-item.status-col,
  .results-row.header .results-item:nth-child(4) {
    display: none !important;
  }

.status-sup {
  display: inline;
  font-size: 0.7em;
  line-height: 1;
  vertical-align: super;
  margin-left: 6px;
  opacity: 0.9;
}

  /* Vis status i parentes (lagt inn i resultat-cellen i PHP) */
  .status-inline { display: inline; }

  /* Tekststil – kompakt og ryddig */
  .results-item {
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;     /* hold på én linje der det gir mening */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Gren (med evt. lang tekst) skal klippes med … */
  .results-item.gren {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Klasse får lov å bryte linje for å unngå … */
  .results-item.klasse {
    white-space: normal;     /* kan bryte */
    overflow: visible;
    text-overflow: clip;
  }

  .results-item.resultat {
  display: flex;
  justify-content: space-between;  /* tekst til venstre, sup til høyre */
  align-items: baseline;           /* holder linjenivået */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Årsoverskrift – litt smalere */
.year-header {
    margin-top: 10px;
    padding: 4px 6px;
    font-size: 14px;
}

/* Litt tettere generelt rundt tabellen på mobil */
.champions-table th,
.champions-table td {
    padding: 5px 6px;
}
}

/* ============================================
   HOMEPAGE – HERO SECTION
   ============================================ */
.hero-section {
    background-color: #003a75;
    color: #eaeaea;
    text-align: center;
    padding: 20px 15px 18px;
    max-width: 1200px;
    margin: 6px auto 0;
    border-radius: 6px;
}

.hero-title {
    color: #fff;
    font-size: clamp(22px, 4vw, 30px);
    margin: 0 0 4px;
    font-weight: 700;
}

.hero-stats {
    color: #b0c4de;
    font-size: clamp(13px, 2.5vw, 16px);
    margin: 0 0 18px;
}

.hero-search-wrapper {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

.hero-search-form {
    position: relative;
}

.hero-search {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.hero-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    outline: none;
    min-width: 0;
}

.hero-search-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background-color: #0066cc;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.hero-search-btn:hover {
    background-color: #0052a3;
}

/* ============================================
   HOMEPAGE – AUTOCOMPLETE
   ============================================ */
.autocomplete-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.autocomplete-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.autocomplete-item:hover {
    background-color: #f0f5ff;
    color: #002652;
    text-decoration: none;
}

/* ============================================
   HOMEPAGE – QUICK NAV
   ============================================ */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 15px 12px;
}

.quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 8px;
    text-decoration: none;
    color: #002652;
    font-weight: 600;
    font-size: clamp(13px, 2.5vw, 15px);
    transition: all 0.2s ease;
}

.quick-nav-item:hover {
    background: #002652;
    color: #eaeaea;
    text-decoration: none;
    border-color: #002652;
}

.quick-nav-icon {
    font-size: clamp(22px, 4vw, 28px);
    line-height: 1;
}

.quick-nav-label {
    line-height: 1.2;
}

/* ============================================
   HOMEPAGE – FEATURED DRIVER
   ============================================ */
.featured-driver {
    padding: 12px;
    margin-bottom: 10px;
}

.featured-driver h2 {
    font-size: clamp(18px, 3.5vw, 22px);
    color: #002652;
    border-bottom: 2px solid #002652;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.featured-driver-card {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.featured-driver-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    text-decoration: none;
}

.featured-driver-image {
    flex-shrink: 0;
    width: 140px;
}

.featured-driver-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-driver-info {
    padding: 12px 12px 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-driver-name {
    font-size: clamp(17px, 3vw, 22px);
    color: #002652;
    margin: 0 0 6px;
    padding: 0;
    background: none;
    border: none;
    font-weight: 700;
}

.featured-driver-stats {
    display: flex;
    gap: 12px;
    font-size: clamp(13px, 2.5vw, 15px);
    color: #555;
    margin-bottom: 8px;
}

.featured-driver-medals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: clamp(12px, 2.2vw, 14px);
}

.medal {
    padding: 2px 8px;
    border-radius: 12px;
    background: #eaeaea;
    color: #333;
    white-space: nowrap;
}

/* ============================================
   HOMEPAGE – RECENT EVENTS
   ============================================ */
.recent-events-home {
    padding: 12px;
    margin-bottom: 10px;
}

.recent-events-home h2 {
    font-size: clamp(18px, 3.5vw, 22px);
    color: #002652;
    border-bottom: 2px solid #002652;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.recent-event-item {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: clamp(13px, 2.5vw, 15px);
}

.recent-event-item:last-child {
    border-bottom: none;
}

.recent-event-date {
    color: #888;
    white-space: nowrap;
    min-width: 120px;
}

.recent-event-name {
    font-weight: 600;
    color: #333;
}

.recent-event-circuit {
    color: #0066cc;
    text-decoration: none;
}

.recent-event-circuit:hover {
    text-decoration: underline;
}

/* ============================================
   HOMEPAGE – RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 640px) {
    .hero-section {
        padding: 20px 12px 18px;
    }

    .quick-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 12px 10px;
    }

    .quick-nav-item {
        padding: 10px 6px;
    }

    .featured-driver-image {
        width: 110px;
    }

    .featured-driver-stats {
        flex-direction: column;
        gap: 2px;
    }

    .recent-event-date {
        min-width: auto;
        width: 100%;
    }
}

@media (min-width: 641px) {
    .quick-nav {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 981px) {
    .quick-nav {
        grid-template-columns: repeat(6, 1fr);
    }

    .featured-driver-image {
        width: 180px;
    }
}

/* ============================================
   DISCIPLINES GRID
   ============================================ */
.discipline-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 15px 12px;
}

.discipline-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #002652;
    transition: all 0.2s ease;
}

.discipline-card:hover {
    background: #002652;
    color: #eaeaea;
    text-decoration: none;
    border-color: #002652;
}

.discipline-card-name {
    font-weight: 700;
    font-size: clamp(16px, 2.5vw, 19px);
    line-height: 1.2;
}

.discipline-card-stats {
    font-size: clamp(12px, 2vw, 13px);
    color: #777;
    line-height: 1.3;
}

.discipline-card:hover .discipline-card-stats {
    color: #b0c4de;
}

@media (min-width: 641px) {
    .discipline-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 981px) {
    .discipline-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   HOMEPAGE – THREE-COLUMN GRID
   ============================================ */
.home-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 12px 12px;
}

.home-col {
    width: 100%;
}

.home-section-title {
    background: none;
    color: #002652;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0 8px;
    margin: 0;
    border-bottom: 2px solid #002652;
    margin-bottom: 10px;
}

/* Quick nav on homepage: always 2 columns (2×3) */
.quick-nav-home {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0;
    gap: 8px;
}

.quick-nav-home .quick-nav-item {
    padding: 18px 10px;
    font-size: 14px;
}

.quick-nav-home .quick-nav-icon {
    font-size: 28px;
}

@media (min-width: 981px) {
    .home-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        align-items: stretch;
        padding: 0 20px 20px;
    }

    /* Nav and drivers fill their column height */
    .home-nav {
        display: flex;
        flex-direction: column;
    }

    .quick-nav-home {
        flex: 1;
    }

    .home-drivers {
        display: flex;
        flex-direction: column;
    }

    .home-drivers .featured-card {
        flex: 1;
    }

    .quick-nav-home .quick-nav-item {
        padding: 22px 10px;
        font-size: 15px;
    }

    .quick-nav-home .quick-nav-icon {
        font-size: 32px;
    }
}

/* ============================================
   HOMEPAGE – FEATURED DRIVER CARDS
   ============================================ */
.featured-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 10px;
}

.featured-card:last-child {
    margin-bottom: 0;
}

.featured-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-color: #002652;
    text-decoration: none;
}

.featured-card-img {
    flex-shrink: 0;
    width: 100px;
    min-height: 100px;
    overflow: hidden;
    background: #ddd;
}

.featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.featured-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    min-width: 0;
}

.featured-card-name {
    font-weight: 700;
    font-size: clamp(15px, 2.5vw, 17px);
    color: #002652;
    line-height: 1.2;
    margin-bottom: 2px;
}

.featured-card-detail {
    font-size: clamp(12px, 2vw, 14px);
    color: #666;
    line-height: 1.3;
}

.featured-card-medals {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.medal-tag {
    font-size: 11px;
    background: #eaeaea;
    color: #333;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Tablet: 2 columns (nav + content side by side) */
@media (min-width: 641px) and (max-width: 980px) {
    .home-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 0 16px 16px;
    }

    .home-nav {
        grid-column: 1 / -1;
    }

    .quick-nav-home {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .home-grid {
        gap: 0;
        padding: 0 10px 10px;
    }

    .featured-card-img {
        width: 90px;
        height: 90px;
    }
}

/* ============================================
   HOMEPAGE – DAY CARDS & CAROUSEL (bursdag/minne)
   ============================================ */
.home-section-memorial {
    margin-top: 16px;
}

/* Enkelt kort (1 person) */
.day-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.day-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    border-color: #002652;
    text-decoration: none;
}

.day-card-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.day-card-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #002652;
    color: #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.day-card-initials.memorial {
    background: #555;
}

.day-card-empty {
    opacity: 0.6;
}

.day-card-empty .day-card-initials {
    background: transparent;
    font-size: 28px;
}

.birthday-tip-link {
    margin: 10px 0 4px;
    font-size: 0.82rem;
    text-align: right;
}
.birthday-tip-link a {
    color: #666;
    text-decoration: none;
}
.birthday-tip-link a:hover {
    color: #002652;
    text-decoration: underline;
}

.day-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-card-name {
    font-weight: 700;
    font-size: clamp(15px, 2.5vw, 17px);
    color: #002652;
}

.day-card-detail {
    font-size: 13px;
    color: #666;
}

/* Karusell (flere personer) */
.day-carousel {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
}

.day-carousel-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.day-carousel-thumb {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.day-carousel-thumb:hover {
    opacity: 0.8;
}

.day-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.day-carousel-thumb span {
    font-size: 11px;
    font-weight: 700;
    color: #666;
}

.day-carousel-slides {
    flex: 1;
    position: relative;
    min-height: 55px;
    overflow: hidden;
}

.day-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.day-slide.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.day-slide.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.day-slide.slide-out-right {
    transform: translateX(100%);
    opacity: 0;
}

.day-slide.slide-in-left {
    transform: translateX(-100%);
    opacity: 0;
}

.day-slide.slide-in-right {
    transform: translateX(100%);
    opacity: 0;
}

.day-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.day-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.day-dot.active {
    background: #002652;
}

/* ============================================
   OTD (PÅ DENNE DAG) WIDGET
   ============================================ */
.otd-widget {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.otd-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.otd-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.otd-item:first-child {
    padding-top: 0;
}

.otd-year {
    font-weight: 700;
    font-size: 14px;
    color: #002652;
}

.otd-description {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.otd-ago {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.otd-link {
    color: #002652;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted #002652;
}

.otd-link:hover {
    border-bottom-style: solid;
}

/* ============================================
   TIPS PORTAL
   ============================================ */
.tips-page {
    padding: 15px;
}

.tip-form-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.tip-form-section h2 {
    font-size: 16px;
    color: #002652;
    border-bottom: 2px solid #002652;
    padding-bottom: 6px;
    margin-bottom: 14px;
}

.tip-search-wrapper {
    position: relative;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #002652;
    box-shadow: 0 0 0 2px rgba(0,38,82,0.1);
}

textarea.form-control {
    resize: vertical;
}

.form-select {
    width: auto;
    min-width: 160px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.form-actions {
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* Knapper */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: #002652;
    color: #fff;
}

.btn-primary:hover {
    background: #001a3d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #fff;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    font-size: 13px;
    padding: 7px 14px;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
}

/* Meldinger */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Eksisterende data visning */
.driver-data-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.driver-data-image img {
    width: 120px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.driver-data-name {
    background: none;
    color: #002652;
    padding: 0;
    margin: 0 0 10px;
    border: none;
    font-size: 18px;
}

.data-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dotted #e0e0e0;
    font-size: 14px;
}

.data-label {
    font-weight: 600;
    color: #555;
    min-width: 110px;
    flex-shrink: 0;
}

.data-value.has-data { color: #002652; }
.data-value.no-data { color: #999; font-style: italic; }

/* Familierelasjoner */
.family-relation-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.family-search-wrap {
    flex: 1;
    position: relative;
}

.family-ac {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-remove {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #999;
    font-size: 18px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover {
    color: #dc3545;
    border-color: #dc3545;
}

@media (max-width: 640px) {
    .tips-page { padding: 10px; }

    .driver-data-grid {
        flex-direction: column;
        gap: 12px;
    }

    .family-relation-row {
        flex-wrap: wrap;
    }

    .form-select {
        width: 100%;
    }
}