/* styles.css - Fælles styles for fam-ostergaard.dk */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #2c5f2d;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Navigation */
nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    position: relative;
    z-index: 1000;
}

nav .main-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
}

nav .menu-item {
    position: relative;
}

/* Toggle button (hidden på desktop) */
nav .submenu-toggle {
    display: none;
}

/* Main menu links */
nav .menu-item > a {
    color: #2c5f2d;
    text-decoration: none;
    font-weight: 500;
    padding: 15px 20px;
    display: block;
    transition: background 0.2s;
}

nav .menu-item > a:hover,
nav .menu-item.active > a {
    background: #e8f5e9;
}

/* Submenu - desktop hover */
nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 250px;
    max-width: 350px;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    z-index: 1001;
    max-height: 70vh;
    overflow-y: auto;
}

nav .menu-item:hover > .submenu {
    display: block;
}

nav .submenu li {
    margin: 0;
}

nav .submenu a {
    display: block;
    padding: 10px 20px;
    color: #2c5f2d;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.2s;
}

nav .submenu a:hover,
nav .submenu li.active a {
    background: #e8f5e9;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    nav .main-menu {
        flex-direction: column;
    }
    
    nav .menu-item {
        border-bottom: 1px solid #e0e0e0;
    }
    
    /* Show toggle button on mobile */
    nav .submenu-toggle {
        display: block;
        position: absolute;
        right: 10px;
        top: 10px;
        background: none;
        border: none;
        width: 30px;
        height: 30px;
        cursor: pointer;
        padding: 5px;
    }
    
    nav .submenu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: #2c5f2d;
        position: relative;
        transition: transform 0.3s;
    }
    
    nav .submenu-toggle span::before,
    nav .submenu-toggle span::after {
        content: '';
        display: block;
        width: 20px;
        height: 2px;
        background: #2c5f2d;
        position: absolute;
        transition: transform 0.3s;
    }
    
    nav .submenu-toggle span::before {
        top: -6px;
    }
    
    nav .submenu-toggle span::after {
        top: 6px;
    }
    
    /* Rotate toggle when open */
    nav .menu-item.open .submenu-toggle span {
        transform: rotate(45deg);
    }
    
    nav .menu-item.open .submenu-toggle span::before {
        top: 0;
        transform: rotate(90deg);
    }
    
    nav .menu-item.open .submenu-toggle span::after {
        opacity: 0;
    }
    
    /* Submenu on mobile */
    nav .submenu {
        position: static;
        box-shadow: none;
        background: #f5f5f5;
        max-width: none;
        max-height: none;
        display: none;
    }
    
    nav .menu-item.open > .submenu {
        display: block;
    }
    
    /* Remove hover on mobile */
    nav .menu-item:hover > .submenu {
        display: none;
    }
    
    nav .menu-item.open:hover > .submenu {
        display: block;
    }
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.9em;
    color: #666;
}

.breadcrumb a {
    color: #2c5f2d;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main content */
main {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

main h1 {
    color: #2c5f2d;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f5e9;
}

main h2 {
    color: #2c5f2d;
    margin-top: 25px;
    margin-bottom: 15px;
}

main h3 {
    color: #4a7c4b;
    margin-top: 20px;
    margin-bottom: 10px;
}

main p {
    margin-bottom: 15px;
}

main img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

main ul, 
main ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

main li {
    margin-bottom: 8px;
}

main table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

main table th,
main table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

main table th {
    background: #e8f5e9;
    color: #2c5f2d;
    font-weight: 600;
}

main a {
    color: #2c5f2d;
    text-decoration: underline;
}

main a:hover {
    color: #1a3a1b;
}

/* Child pages */
.child-pages {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.child-pages h2 {
    color: #2c5f2d;
    margin-bottom: 15px;
}

.child-pages ul {
    list-style: none;
    margin-left: 0;
}

.child-pages li {
    margin-bottom: 10px;
}

.child-pages a {
    color: #2c5f2d;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.child-pages a:hover {
    background: #e8f5e9;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    nav .main-menu {
        flex-direction: column;
        gap: 0;
    }
    
    nav .submenu,
    nav .mega-dropdown {
        position: static;
        box-shadow: none;
        background: #f5f5f5;
    }
    
    nav .mega-columns {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
}

/* Skjul ProcessWire's default admin menu og content i bunden */
#pw-body-copy,
body > ul:last-of-type,
body > a[href*="Home"],
body > div:last-child {
    display: none !important;
}

/* Skjul processwire default breadcrumb og content */
body > a:first-of-type,
body > :last-child:not(script):not(footer) {
    display: none !important;
}

/* Mere aggressiv skjuling af PW default markup */
body > a[href^="/"],
body > ul:not(.main-menu):not(.submenu):not(.child-pages ul) {
    display: none !important;
}

/* Skjul specifikke PW default elementer */
body > *:not(header):not(nav):not(main):not(footer):not(script):not(style):not(.container) {
    display: none !important;
}
