mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
221 lines
5.3 KiB
CSS
221 lines
5.3 KiB
CSS
/* ============================================================
|
|
HEADER — Site header, navigation, hamburger menu
|
|
Root class: header (element selector — the only instance)
|
|
============================================================ */
|
|
|
|
/* ── Header bar ─────────────────────────────────────────────────────── */
|
|
|
|
header {
|
|
vertical-align: center;
|
|
flex-shrink: 0;
|
|
background: linear-gradient(
|
|
180deg,
|
|
var(--gradient-1) 0%,
|
|
var(--gradient-2) 33%,
|
|
var(--gradient-3) 66%,
|
|
var(--gradient-4) 100%
|
|
);
|
|
}
|
|
|
|
/* ── Navigation ────────────────────────────────────────────────────── */
|
|
|
|
header nav {
|
|
padding: var(--space-s) var(--space-s);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
font-size: var(--step-0);
|
|
}
|
|
|
|
header nav ul {
|
|
display: flex;
|
|
gap: var(--space-l);
|
|
align-items: center;
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
header nav ul a {
|
|
font-family: var(--font-display);
|
|
letter-spacing: 0.12em;
|
|
text-transform: uppercase;
|
|
color: var(--accent-foreground);
|
|
text-decoration: none;
|
|
padding: var(--space-3xs) var(--space-xs);
|
|
border-radius: var(--radius);
|
|
text-shadow:
|
|
0 0 16px var(--header-shadow-strong),
|
|
0 0 32px var(--header-shadow-soft);
|
|
transition: opacity 0.15s;
|
|
}
|
|
|
|
header nav ul a:hover {
|
|
color: var(--accent-primary);
|
|
}
|
|
|
|
header nav ul a[aria-current="page"] {
|
|
opacity: 1;
|
|
border-bottom: 1px solid var(--header-nav-active-border);
|
|
padding-bottom: 1px;
|
|
color: var(--accent-foreground);
|
|
}
|
|
|
|
/* ── Logo ───────────────────────────────────────────────────────────── */
|
|
|
|
.nav-logo {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.nav-left-links,
|
|
.nav-right-links {
|
|
display: flex;
|
|
gap: var(--space-l);
|
|
align-items: center;
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.nav-top-row {
|
|
display: contents;
|
|
}
|
|
|
|
.nav-mobile-links {
|
|
display: none;
|
|
}
|
|
|
|
/* ── Hamburger menu (pure CSS, checkbox trick) ──────────────────────── */
|
|
/* DOM order (public only):
|
|
input.menu-btn ← off-screen checkbox
|
|
nav
|
|
div.nav-top-row ← always-visible row
|
|
ul.nav-left-links ← logo + Répertoire
|
|
ul.nav-right-links ← Licences, À Propos
|
|
label.menu-icon ← burger icon trigger
|
|
ul.nav-mobile-links ← full dropdown (hidden by default) */
|
|
|
|
.menu-btn {
|
|
position: absolute;
|
|
top: -9999px;
|
|
left: -9999px;
|
|
}
|
|
|
|
.menu-icon {
|
|
display: none;
|
|
cursor: pointer;
|
|
padding: var(--space-2xs) var(--space-s);
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Middle bar of the burger icon */
|
|
.navicon {
|
|
background: var(--accent-foreground);
|
|
display: block;
|
|
height: 2px;
|
|
width: 24px;
|
|
position: relative;
|
|
transition: all 0.3s ease-out;
|
|
}
|
|
|
|
.navicon::before,
|
|
.navicon::after {
|
|
content: "";
|
|
background: var(--accent-foreground);
|
|
display: block;
|
|
height: 2px;
|
|
width: 100%;
|
|
position: absolute;
|
|
transition: all 0.3s ease-out;
|
|
}
|
|
|
|
.navicon::before { top: -7px; }
|
|
.navicon::after { bottom: -7px; }
|
|
|
|
/* ── Mobile (≤ 640px) ───────────────────────────────────────────────── */
|
|
|
|
@media screen and (max-width: 640px) {
|
|
header nav[aria-label="Navigation principale"] {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
padding: 0;
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-top-row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: var(--space-s);
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-right-links {
|
|
display: none;
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-left-links {
|
|
display: flex;
|
|
gap: 0;
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"]
|
|
.nav-left-links li:not(:first-child) {
|
|
display: none;
|
|
}
|
|
|
|
.menu-icon { display: flex; }
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-mobile-links {
|
|
display: block;
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
max-height: 0;
|
|
overflow: hidden;
|
|
transition: max-height 0.2s ease-out;
|
|
}
|
|
|
|
.menu-btn:checked
|
|
~ nav[aria-label="Navigation principale"]
|
|
.nav-mobile-links {
|
|
max-height: 300px;
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-mobile-links li {
|
|
border-top: 1px solid var(--header-nav-active-border);
|
|
text-align: left;
|
|
}
|
|
|
|
header nav[aria-label="Navigation principale"] .nav-mobile-links li a {
|
|
display: block;
|
|
width: 100%;
|
|
padding: var(--space-s) var(--space-s);
|
|
text-align: left;
|
|
}
|
|
|
|
/* Animate burger → X */
|
|
.menu-btn:checked
|
|
~ nav[aria-label="Navigation principale"]
|
|
.menu-icon
|
|
.navicon {
|
|
background: transparent;
|
|
}
|
|
|
|
.menu-btn:checked
|
|
~ nav[aria-label="Navigation principale"]
|
|
.menu-icon
|
|
.navicon::before {
|
|
transform: rotate(-45deg);
|
|
top: 0;
|
|
}
|
|
|
|
.menu-btn:checked
|
|
~ nav[aria-label="Navigation principale"]
|
|
.menu-icon
|
|
.navicon::after {
|
|
transform: rotate(45deg);
|
|
bottom: 0;
|
|
}
|
|
}
|