@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    /* GRATTON BRAND COLORS */
    --navy:     #0F2040; 
    --gold:     #ea580c; /* Dyp oransje */
    --navy-light: #1a3a6e; 
    --dark-base: #050a14; 
    
    /* UI COLORS */
    --cream:    #fdfbf7; 
    --warm-beige: #f4ede4;
    --light-blue: #e0f2fe;
    --white:    #ffffff;
    --text:     #334155; 
    --red:      #9f1239; 
    --green:    #15803d; 
    --sr-blue:  #818cf8;
    
    /* VARS */
    --radius: 4px;     
    --radius-btn: 30px; 
    --shadow: 0 10px 30px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--text); font-family: 'Inter', sans-serif; line-height: 1.7; font-weight: 300; }
b, strong { font-weight: 700 !important; color: var(--navy); }

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: var(--navy); margin-top: 0; line-height: 1.2; font-weight: 400; }
a { color: inherit; text-decoration: none; transition: 0.3s; }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }
.center-text { text-align: center; display: block; margin: 20px 0; }

/* HEADER */
.main-header { 
    text-align: center; 
    padding: 80px 20px; 
    background: radial-gradient(circle at center, var(--navy-light) 0%, var(--navy) 100%); 
    color: var(--white); 
    position: relative; 
    margin-bottom: 60px; 
}
.logo-wrapper { background: var(--white); padding: 25px; display: inline-block; border-radius: var(--radius); margin-bottom: 30px; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
.logo { width: 180px; display: block; }
.mag-title { font-size: 3.5rem; text-transform: uppercase; letter-spacing: 2px; color: var(--white); margin: 0; font-weight: 400; }
.issue-meta { margin-top: 15px; font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 3px; font-size: 0.75rem; color: var(--gold); font-weight: 400; }

.archive-link { 
    position: absolute; top: 20px; right: 20px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; 
    border: 1px solid rgba(255,255,255,0.3); padding: 8px 20px; border-radius: var(--radius-btn); 
    background: transparent; color: var(--white); transition: 0.3s;
}
.archive-link:hover { background: var(--white); color: var(--navy); border-color: var(--white); }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }
.home-grid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 60px; align-items: start; }

/* MAGAZINE GRID */
.article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

.mag-card { 
    background: var(--white); border-radius: var(--radius); overflow: hidden; 
    box-shadow: var(--shadow); margin-bottom: 0; 
    transition: transform 0.3s; position: relative; 
    display: flex; flex-direction: column;
}
.mag-card:hover { transform: translateY(-3px); }
.mag-card .card-img { height: 250px; object-fit: cover; object-position: top center; width: 100%; }
.card-body { padding: 30px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.mag-card h2 { font-size: 1.6rem; margin-bottom: 15px; font-weight: 400; }

/* GRID PATTERN */
.article-grid > .mag-card:nth-child(1),
.article-grid > .mag-card:nth-child(4) { grid-column: 1 / -1; }
.article-grid > .mag-card:nth-child(1) .card-img,
.article-grid > .mag-card:nth-child(4) .card-img { height: 400px; object-position: top center; }
.article-grid > .mag-card:nth-child(1) h2,
.article-grid > .mag-card:nth-child(4) h2 { font-size: 2.2rem; }

.meta { font-family: 'Inter', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); margin-bottom: 15px; font-weight: 600; }

.read-link { 
    display: inline-block; background: var(--navy); color: var(--white);
    padding: 10px 25px; border-radius: var(--radius-btn);
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.75rem; 
    text-transform: uppercase; letter-spacing: 1px;
    border: 1px solid var(--navy); margin-top: 10px; transition: 0.3s; width: fit-content;
}
.read-link:hover { background: var(--gold); color: var(--white); border-color: var(--gold); transform: translateY(-2px); }

/* CREATIVE */
.mag-card.creative { background: var(--light-blue); text-align: center; border: 1px solid rgba(0,0,0,0.05); box-shadow: none; }
.student-badge { position: absolute; top: 0; right: 0; background: var(--navy); color: var(--gold); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 8px 15px; border-radius: 0 0 0 var(--radius); }
.mag-card.creative .card-body { padding: 50px 30px; }
.mag-card.creative h2 { font-style: italic; font-weight: 400; font-size: 2rem; color: var(--navy); margin-bottom: 10px; }
.creative-type { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: var(--navy); opacity:0.7; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px; display: block; font-weight: 600; }

/* AGENDA */
.agenda-box { 
    background: radial-gradient(circle at top left, var(--navy-light) 0%, var(--navy) 100%);
    color: var(--white); 
    padding: 35px; border-radius: var(--radius); box-shadow: var(--shadow); 
}
.sidebar-title { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 25px; }
.event-card { display: flex; gap: 20px; align-items: center; margin-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 20px; }
.event-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.event-date { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 10px; border-radius: 8px; text-align: center; min-width: 65px; }
.event-date .day { display: block; font-size: 1.5rem; font-weight: 400; color: var(--white); line-height: 1; font-family: 'Playfair Display', serif; }
.event-date .month { display: block; font-size: 0.6rem; text-transform: uppercase; color: var(--gold); margin-top: 4px; font-weight: 600; font-family: 'Inter', sans-serif; }
.event-details h4 { color: var(--white); font-size: 1.1rem; margin-bottom: 5px; font-family: 'Playfair Display', serif; font-weight: 400; }
.event-link { font-size: 0.7rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 2px; }
.event-link:hover { color: var(--gold); border-color: var(--gold); }

/* ARTICLE PAGE */
.article-wrapper { max-width: 1100px; margin: 60px auto; padding: 0 20px; display: grid; grid-template-columns: 2.5fr 1fr; gap: 60px; }
.article-main { background: var(--white); padding: 60px; border-radius: var(--radius); box-shadow: var(--shadow); }
.top-nav { background: var(--navy); padding: 15px 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.article-header { text-align: center; margin-bottom: 40px; }
.article-header h1 { font-size: 2.2rem; margin-bottom: 15px; font-weight: 400; color: var(--navy); line-height: 1.2; }
.event-hero-date { display: inline-block; background: var(--red); color: #fff; padding: 5px 15px; border-radius: 20px; font-family: 'Inter', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; margin-bottom: 15px; }
/* MASSIVT HERO-BILDE PÅ ARTIKKEL */
.article-hero-img { 
    width: 100%; 
    height: 50vh; /* Tar opp halve skjermhøyden */
    min-height: 400px;
    object-fit: cover; 
    border-radius: var(--radius); 
    margin-bottom: 40px; 
    box-shadow: var(--shadow);
}.article-body { font-size: 1.2rem; font-family: 'Georgia', serif; color: #222; line-height: 1.8; }
.article-body a { color: var(--navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; transition: 0.2s; }
.article-body a:hover { color: var(--red); text-decoration-color: var(--red); }

/* SIDEBAR/SHARE (HOVER RESTORED) */
.article-sidebar { height: fit-content; position: sticky; top: 20px; }
.sidebar-inner { background: transparent; padding: 20px 0 0 20px; text-align: left; }
.sidebar-head { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-bottom: 30px; color: var(--navy); font-weight: 400; position: relative; padding-bottom: 15px; }
.sidebar-head::after { content: ""; position: absolute; bottom: 0; left: 0; width: 60px; height: 3px; background: var(--gold); }

/* Link Container */
.sidebar-link { 
    display: block; padding: 15px 0; border-bottom: 1px solid rgba(0,0,0,0.05); 
    transition: 0.3s; text-decoration: none; 
}
.sidebar-link:last-child { border-bottom: none; }

/* Title Styling */
.sidebar-link h4 { 
    font-size: 1.1rem; margin: 0 0 8px 0; font-family: 'Playfair Display', serif; 
    color: var(--text); line-height: 1.3; font-weight: 400; transition: 0.3s; 
}

/* Button Styling */
.sidebar-btn-sm { 
    font-size: 0.75rem; text-transform: uppercase; font-weight: 600; 
    color: var(--gold); letter-spacing: 1px; display: inline-block; transition: 0.3s; 
}

/* THE HOVER EFFECTS */
.sidebar-link:hover h4 { color: var(--navy); } 
.sidebar-link:hover .sidebar-btn-sm { color: var(--red); transform: translateX(5px); letter-spacing: 2px; }

/* Share Section */
.share-section { margin-top: 60px; border-top: 1px solid #eee; padding-top: 30px; text-align: center; }
.share-label { font-size: 0.7rem; text-transform: uppercase; color: #999; margin-bottom: 15px; display: block; letter-spacing: 2px; }
.share-btn { display: inline-block; padding: 10px 25px; margin: 0 5px; border-radius: var(--radius-btn); font-size: 0.8rem; font-weight: 600; background: #f4f4f4; color: #333; border: 1px solid #ddd; transition: 0.3s; }
.share-btn:hover { background: transparent; border-color: #999; transform: translateY(-2px); }

/* FOOTER */
.main-footer { 
    background: radial-gradient(circle at bottom center, var(--navy-light) 0%, var(--dark-base) 100%);
    color: rgba(255,255,255,0.7); 
    padding: 100px 20px 60px; 
    margin-top: 80px; 
    border-top: 6px solid var(--gold); 
    position: relative; overflow: hidden;
}
.footer-watermark {
    position: absolute; bottom: -30px; right: 0;
    font-family: 'Playfair Display', serif; font-size: 15vw; font-weight: 700;
    color: rgba(255,255,255,0.03); pointer-events: none; line-height: 0.8; z-index: 0; white-space: nowrap;
}
.footer-container { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; position: relative; z-index: 1; }
.footer-col { flex: 1; min-width: 250px; } .footer-col.right { text-align: right; }

.footer-col h4 { color: var(--white); margin-bottom: 10px; font-size: 2.2rem; font-family: 'Playfair Display', serif; font-weight: 400; line-height:1; }
.footer-sub { color: var(--gold); font-family: 'Inter', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px; display: block; font-weight: 600; }
.footer-slogan { color: rgba(255,255,255,0.6); font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 300; line-height: 1.6; max-width: 300px; }
.footer-heading { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; font-weight: 700; }

.footer-link { 
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.8); margin-bottom: 12px; 
    text-decoration: none; font-weight: 300; transition: 0.3s; 
    border-bottom: 1px solid transparent; padding-bottom: 2px; width: fit-content;
}
.footer-col.right .footer-link { margin-left: auto; margin-right: 0; }
.footer-link:hover { color: var(--gold); transform: translateX(5px); border-bottom-color: var(--gold); }
.footer-col.right .footer-link:hover { transform: translateX(-10px); }
.footer-link i { color: var(--gold); width: 20px; text-align: center; font-size: 0.9rem; }

.copyright { max-width: 1100px; margin: 60px auto 0; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: rgba(255,255,255,0.4); position: relative; z-index: 1; }

/* SLOWRAIN SIGNATURE */
.slowrain-link { text-decoration: none; font-family: 'Inter', sans-serif !important; font-weight: 600 !important; letter-spacing: 1px; text-transform: uppercase; font-size: 0.7rem; transition: 0.3s; }
.sr-vibe { color: var(--sr-blue) !important; transition: 0.3s; } 
.sr-name { color: var(--white) !important; transition: 0.3s; }
.slowrain-link:hover .sr-vibe { color: var(--sr-blue); } 
.slowrain-link:hover .sr-name { color: var(--sr-blue); } 
.slowrain-link:hover { letter-spacing: 2px; }

/* ADMIN STYLES */
.admin-body { background: #f1f5f9 !important; font-family: 'Inter', sans-serif; }
.admin-header { background: var(--navy); color: var(--white); padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.admin-title { font-weight: 600; font-size: 1.2rem; letter-spacing: 2px; text-transform: uppercase; }
.admin-nav a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.85rem; margin-left: 20px; font-weight: 600; text-transform: uppercase; }
.admin-container { max-width: 1200px; margin: 40px auto; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; padding: 0 20px; }
.admin-card { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 30px; border: 1px solid #e2e8f0; }
.form-group { margin-bottom: 25px; }
label { display: block; margin-bottom: 8px; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; color: #64748b; letter-spacing: 1px; }
input, select, textarea { width: 100%; padding: 15px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 1rem; background: #fff; }
textarea.formatted { min-height: 400px; font-family: 'Georgia', serif; }
.checkbox-wrapper { background: #fdf2f8; padding: 15px; border-radius: 4px; border: 1px solid #fbcfe8; display: flex; align-items: center; gap: 10px; color: #be185d; font-weight: bold; }
.checkbox-wrapper input { width: auto; }
.drop-zone { border: 2px dashed #cbd5e1; padding: 30px; text-align: center; background: #f8fafc; border-radius: 4px; cursor: pointer; }

.btn-primary { background: var(--navy); color: #fff; padding: 12px 30px; width: 100%; border: 1px solid var(--navy); border-radius: var(--radius-btn); cursor: pointer; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.btn-primary:hover { background: transparent; color: var(--navy); }
.btn-secondary { background: transparent; color: var(--text); padding: 12px 25px; border: 1px solid #cbd5e1; border-radius: var(--radius-btn); cursor: pointer; font-weight: 600; text-transform: uppercase; transition: 0.3s; }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* FILTER BUTTONS */
.filter-nav { display:flex; gap:10px; margin-bottom:20px; }
.filter-btn { background: transparent; border: 1px solid #cbd5e1; color: #64748b; padding: 5px 15px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; cursor: pointer; transition: 0.2s; }
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* COMPACT ADMIN ITEMS */
.admin-item {
    display: flex; justify-content: space-between; align-items: center; 
    background: #fff; margin-bottom: 5px; padding: 10px 15px; 
    border-radius: 4px; border-left: 4px solid transparent; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: 0.2s;
}
.admin-item:hover { transform: translateX(2px); }
.admin-item.event { border-left-color: var(--green); background: #f0fdf4; }
.admin-item.creative { border-left-color: var(--sr-blue); background: #eff6ff; }
.admin-item.article { border-left-color: var(--navy); }

.admin-item-title { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; vertical-align: middle; }
.admin-item-type { font-size: 0.65rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; margin-left: 10px; letter-spacing: 1px; }

.admin-actions { display: flex; gap: 15px; align-items: center; }
.action-icon { font-size: 1rem; color: #cbd5e1; transition: 0.2s; cursor: pointer; }
.action-icon:hover { color: var(--navy); transform: scale(1.1); }
.action-icon.del:hover { color: var(--red); }

.sortable-ghost { background: #eef2ff !important; border: 1px dashed var(--navy) !important; opacity: 0.5; }
.handle { color: #cbd5e1; cursor: grab; padding: 5px 10px 5px 0; }
.handle:hover { color: var(--navy); }

/* ADMIN FOOTER */
.admin-footer { text-align: center; margin-top: 60px; padding-bottom: 40px; color: #94a3b8; font-size: 0.75rem; border-top: 1px solid #e2e8f0; padding-top: 20px; }
.admin-footer .slowrain-link .sr-name { color: #64748b !important; }
.admin-footer .slowrain-link:hover .sr-name { color: var(--sr-blue) !important; }

/* LIGHTBOX */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.95); z-index: 1000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.lightbox.active { display: flex; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; }
.lightbox-content img { max-width: 100%; max-height: 90vh; border-radius: 4px; box-shadow: 0 0 50px rgba(0,0,0,0.5); display: block; margin: 0 auto; }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: rgba(255,255,255,0.6); font-size: 2rem; cursor: pointer; padding: 20px; }
.lb-close { position: absolute; top: 20px; right: 30px; background: transparent; border: none; color: rgba(255,255,255,0.6); font-size: 2rem; cursor: pointer; }
.lb-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.5); font-family: 'Inter', sans-serif; font-size: 0.8rem; letter-spacing: 2px; }

@media(max-width:800px) { .home-grid, .article-wrapper, .admin-container, .footer-container { grid-template-columns: 1fr; } .float-img { float: none; width: 100%; margin: 0 0 20px 0; } }
/* =========================================
   SEARCH BAR (INDEX)
   ========================================= */
.search-wrapper { margin-bottom: 40px; position: relative; max-width: 600px; margin-left: auto; margin-right: auto; }
.search-input { width: 100%; padding: 15px 20px 15px 50px; border: 2px solid #e2e8f0; border-radius: 30px; font-size: 1.1rem; outline: none; transition: 0.3s; font-family: 'Inter', sans-serif; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.search-icon { position: absolute; left: 20px; top: 18px; color: #94a3b8; font-size: 1.2rem; }

/* =========================================
   PRINT MEDIA QUERY ("BESTEMOR-KODEN")
   ========================================= */
@media print {
    body { background: #fff !important; color: #000 !important; font-size: 12pt; }
    /* Skjul alt som ikke er selve artikkelen */
    .top-nav, .main-header, .article-sidebar, .share-section, .main-footer, .lightbox, #progress-bar, .admin-footer, .search-wrapper { display: none !important; }
    
    /* Fiks layouten for A4 */
    .article-wrapper { display: block; width: 100%; margin: 0; padding: 0; box-shadow: none; }
    .article-main { width: 100%; padding: 0; }
    .article-hero-img { height: auto; max-height: 400px; page-break-inside: avoid; border-radius: 0; box-shadow: none; margin-bottom: 20px; }
    h1, h2, h3 { page-break-after: avoid; color: #000 !important; }
    p, pre, blockquote, img { page-break-inside: avoid; }
    a { text-decoration: underline; color: #000; }
}