/* ============================================
   BASE STYLES - Fælles styles for alle sider
   ============================================ */

/* CSS Variables */
:root {
    --text: #111;
    --muted: #666;
    --line: rgba(0, 0, 0, .08);
    --accent: #b0854d;
    --bg: #fff;
    --overlay: rgba(0, 0, 0, .5);
}

/* Reset */
* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    padding: 0
}

html {
    height: 100%;
}

body {
    font-family: Helvetica, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   MAIN BODY
   ============================================ */
.main-body {
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

/* Allow wider width for hero section */
.main-body:has(.hero) {
    max-width: 1200px;
}

/* Wider width for screens larger than 1400px */


/* ============================================
   HEADER
   ============================================ */
header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

header.hidden {
    transform: translateY(-100%);
}

body {
    padding-top: 80px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    align-items: center;
}

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

.logo {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .08em;
    font-size: 1.4rem;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-size: 1.4rem;
}

.logo-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: .05em;
    margin-top: 2px;
}

.logo:hover {
    color: var(--accent);
}

.logo:hover .logo-main,
.logo:hover .logo-subtitle {
    color: var(--accent);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 22px
}

nav a {
    text-decoration: none;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: 1rem;
    font-weight: 600;
}

nav a:hover {
    color: var(--accent);
}

.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    left: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 260px;
    padding: .35rem 0;
    display: none;
    z-index: 1000
}

.dropdown:hover .dropdown-content {
    display: block
}

/* Show dropdown when toggled via touch/click */
.dropdown.show .dropdown-content {
    display: block
}

.dropdown-content a {
    display: block;
    padding: .6rem .9rem
}

/* Mobile dropdown is hidden by default, shown on mobile */
.mobile-dropdown {
    display: none;
}

/* ============================================
   SECTIONS & CONTAINERS
   ============================================ */
.section {
    padding: 3.25rem 0
}

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

/* Wider width for screens larger than 1400px */

/* Set max-width for container when it contains grid (projects) */
.container:has(.grid) {
    max-width: 1200px;
    padding: 0 24px;
}

/* Allow wider width for main-body when it contains grid (projects) */
.main-body:has(.grid) {
    max-width: 1200px;
    padding: 0 24px;
}

/* Wider width for screens larger than 1400px */

/* Limit grid width to 750px when screen size is between 800-1200px */
@media (min-width: 800px) and (max-width: 1199px) {
    .container:has(.grid) {
        max-width: 750px;
    }
    
    .main-body:has(.grid) {
        max-width: 750px;
    }
}

.section-title {
    text-align: center;
    margin: 1rem 0 1.75rem;
    font-weight: 700
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: 100%
}

/* Desktop 800px+: 3 projects per line */
@media (min-width: 800px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        justify-items: center;
    }
}

/* Desktop 1200px+: 4 projects per line */
@media (min-width: 1200px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
        justify-items: center;
    }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #fff;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 5px 24px;
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: space-between;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--line);
    padding: 14px 24px;
    color: var(--muted)
}

.footer-container h4 {
    font-size: 1rem;
    margin-top: 10px;
    margin-bottom: 0px;
}

.footer-container a {
    font-size: 1rem;
    margin-top: 5px;
    padding-right: 10px;
    color: inherit;
    text-decoration: none;
}

.footer-container a:link,
.footer-container a:visited,
.footer-container a:active {
    color: inherit;
}

.footer-container a:hover {
    color: var(--accent);
}

.footer-container p {
    font-size: 1rem;
    margin-top: 0px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 799px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        transition: transform 0.3s ease;
    }
    
    header.hidden {
        transform: translateY(-100%);
    }
    
    /* Body padding already set above for desktop */
    
    /* Reduce padding on small screens */
    .main-body {
        padding: 0 0.75rem;
    }
    
    .container:has(.grid) {
        padding: 0 0.75rem;
    }
    
    .main-body:has(.grid) {
        padding: 0 0.75rem;
    }
    
    /* Hide regular nav items on mobile */
    nav ul li {
        display: none;
    }
    
    /* Show mobile dropdown */
    .mobile-dropdown {
        display: block;
        position: relative;
    }
    
    .mobile-dropdown-toggle {
        background: #fff;
        border: 1px solid var(--line);
        padding: 0.5rem 1rem;
        color: var(--text);
        text-transform: uppercase;
        letter-spacing: .11em;
        font-size: .86rem;
        cursor: pointer;
        border-radius: 4px;
        font-family: inherit;
        transition: all 0.2s ease;
    }
    
    .mobile-dropdown-toggle:hover {
        background: var(--bg);
        border-color: var(--accent);
        color: var(--accent);
    }
    
    .mobile-dropdown-content {
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        min-width: 200px;
        padding: .35rem 0;
        display: none;
        z-index: 1000;
        margin-top: 0.5rem;
    }
    
    .mobile-dropdown-content.active {
        display: block;
    }
    
    .mobile-dropdown-content a {
        display: block;
        padding: .6rem .9rem;
        text-decoration: none;
        color: var(--text);
        text-transform: uppercase;
        letter-spacing: .11em;
        font-size: .86rem;
    }
    
    .mobile-dropdown-content a:hover {
        background: var(--bg);
        color: var(--accent);
    }
    
    .mobile-dropdown-item {
        position: relative;
    }
    
    .mobile-dropdown-link {
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        padding: .6rem .9rem;
        color: var(--text);
        text-transform: uppercase;
        letter-spacing: .11em;
        font-size: .86rem;
        cursor: pointer;
        font-family: inherit;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-dropdown-link::after {
        content: '▼';
        font-size: 0.7rem;
        margin-left: 0.5rem;
        transition: transform 0.2s ease;
    }
    
    .mobile-dropdown-link.active::after {
        transform: rotate(180deg);
    }
    
    .mobile-dropdown-link:hover {
        background: var(--bg);
        color: var(--accent);
    }
    
    .mobile-dropdown-submenu {
        display: none;
        background: var(--bg);
        border-top: 1px solid var(--line);
    }
    
    .mobile-dropdown-submenu.active {
        display: block;
    }
    
    .mobile-dropdown-submenu a {
        padding-left: 1.8rem;
        font-size: 0.8rem;
    }
    
    .header-container {
        padding: 20px 12px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    nav a {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    /* Footer tekst bliver mindre på mobile */
    .footer-container h4 {
        font-size: 0.95rem;
    }
    
    .footer-container a {
        font-size: 0.95rem;
    }
    
    .footer-container p {
        font-size: 0.95rem;
    }
    
    .footer-bottom {
        font-size: 0.95rem;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Footer tekst bliver mindre ved 768px */
    .footer-container h4 {
        font-size: 0.85rem;
    }
    
    .footer-container a {
        font-size: 0.85rem;
    }
    
    .footer-container p {
        font-size: 0.85rem;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    /* Footer tekst bliver endnu mindre ved 600px */
    .footer-container h4 {
        font-size: 0.7rem;
    }
    
    .footer-container a {
        font-size: 0.7rem;
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .footer-container p {
        font-size: 0.7rem;
    }
    
    .footer-bottom {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    /* Footer tekst bliver endnu mindre ved 400px */
    .footer-container h4 {
        font-size: 0.6rem;
    }
    
    .footer-container a {
        font-size: 0.6rem;
    }
    
    .footer-container p {
        font-size: 0.6rem;
    }
    
    .footer-bottom {
        font-size: 0.6rem;
    }
    
    .main-body {
        padding: 0 0.75rem;
    }
    
    .container:has(.grid) {
        padding: 0 0.75rem;
    }
    
    .main-body:has(.grid) {
        padding: 0 0.75rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mobile-dropdown-content {
        min-width: 150px;
    }

    .section-title {
        margin: 0.5rem 0.5rem;
    }
}

@media (max-width: 370px) {
    .footer-container div {
        max-width: 85px;
    }
}

@media (max-width: 342px) {
    .header-container {
        padding: 0.5rem 12px;
    }

    body {
        padding-top: 90px;
    }
}

/* Very small screens (320px): Ensure everything can shrink */
@media (max-width: 320px) {
    html, body {
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .main-body {
        padding: 0 0.5rem;
        min-width: 0;
    }
    
    .container:has(.grid) {
        padding: 0 0.5rem;
    }
    
    .main-body:has(.grid) {
        padding: 0 0.5rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .mobile-dropdown-content {
        min-width: 120px;
        right: -10px;
    }
    
    .header-container {
        padding: 0.5rem 0.5rem;
    }
}

@media (min-width: 1450px) {
    .header-container {
        max-width: 1400PX;
    }
}

