summaryrefslogtreecommitdiff
path: root/stylesheets/commun.css
blob: 174ab7d1f54a12843f26b2285bf07605a7fe2498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
body {
    --gold: #E4B63A;

    margin: 0;
    background-color: white;
    font-family: 'Open Sans', sans-serif;
}

a {
    color: inherit;
}
a.current {
    color: var(--gold);
}

header a {
    text-decoration: none;
}
nav a:hover {
    color: var(--gold);
    background: white;
}

header.banner a {
    display: flex;
    align-items: center;
}
header.banner img {
    margin: 0.6rem;
}
header.banner h1 {
    margin: 0;
    font-family: 'Cormorant', serif;
}

header.banner img, .social a img {
    filter: brightness(0);
}
header.banner:hover img, .social a:hover img {
    filter: none;
}
header.banner:hover {
    color: var(--gold);
}

nav a {
    font-size: 1.2rem;
    font-weight: 600;
}

nav > ol, nav li.dropdown > ul {
    list-style-type: none;
    padding-left: 0;
}
nav > ol > li > a {
    display: block;
    padding: 0.5em 0.1em;
}

footer.social a {
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}
footer.social a.contact:hover {
    color: var(--gold);
    background: white;
}

footer.social a.lang {
    display: block;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1rem;

    border: 0.15rem solid black;
}
footer.social a.lang:hover {
    color: white;
    background: var(--gold);
    border: 0.15rem solid var(--gold);
}

footer.social {
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer.legal {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    margin: auto;
    font-size: 75%;
}

@media (min-width: 40em) {
    body {
        --banner-logo-height: 11rem;
        --banner-name-height: 2.4rem;
        --menu-top-margin: calc((var(--banner-logo-height)
                                 - 2 * var(--banner-name-height))
                                / 2);

        min-height: 100vh;
        display: grid;
        grid-template-columns: 2fr 1fr 4fr 1fr auto;
        grid-template-rows: auto 1fr auto;
    }

    header.banner {
        grid-column: 1;
    }
    header.banner img {
        height: var(--banner-logo-height);
    }
    header.banner h1 {
        font-size: var(--banner-name-height);
        font-weight: normal;
        max-width: 6em;         /* Force linebreak. */
    }

    header.menu {
        grid-column: 3 / -2;
        display: grid;
        grid-template-columns: 3fr 1fr;
    }

    header.menu nav {
        grid-column: 1;
        margin-top: var(--menu-top-margin);
    }

    nav > ol {
        display: grid;
        align-items: center;
        align-content: stretch;
        text-align: center;
        margin: 0;
    }

    /* I'd like to make sure the grid only ever has 1/2/4 columns.
     * No idea how to do that with one single neat rule, so…
     * 🤖 Go Go Gadget Mediaquery 🤖 */

    @media (min-width: 50em) {
        nav > ol {
            grid-template-columns: repeat(2, minmax(8em, 1fr));
        }
    }

    @media (min-width: 80em) {
        nav > ol {
            grid-template-columns: repeat(auto-fill, minmax(8em, 1fr));
        }
    }

    nav li.dropdown {
        position: relative;
    }
    nav li.dropdown ul {
        position: absolute;
        width: 100%;
        background: #ddd8;
        z-index: 1;

        overflow: hidden;
        max-height: 0;
        transition: max-height 0.5s;
    }
    nav li.dropdown:hover > a {
        background: white;
        color: var(--gold);
    }
    nav li.dropdown:hover ul {
        /* ⚠ Magic constant: must be big enough to show the whole dropdown,
           but not too big otherwise the transition will be "delayed". */
        max-height: 20rem;
    }
    nav li.dropdown > ul > li {
        list-style-type: none;
    }
    nav li.dropdown > ul > li:hover {
        background: white;
    }
    nav li.dropdown > ul > li a {
        display: block;       /* Make link span whole containing block. */
    }

    main {
        grid-row: 2;
        grid-column: 1 / -2;
        font-size: 1.2rem;
        margin-left: 4em;
    }

    footer.social {
        grid-row: 1 / -2;
        grid-column: 5;
        padding: var(--menu-top-margin) 1em 0;
    }

    .social a {
        display: block;
        margin: 1rem;
    }

    .social a > img {
        width: 2.2rem;
    }

    a.contact {
        /* Ideally should be just: */
        /* writing-mode: sideways-lr; */
        /* but of course We Can't Have Nice Things. */
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        padding: 1rem 0.5rem;
        margin: 0;              /* Compensate padding. */
    }
}

@media (max-width: 40em) {
    body {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        min-height: 100vh;
    }

    header.banner {
        grid-row: 1;
    }
    header.menu, footer.social {
        display: none;
    }
    footer.legal {
        grid-row: 3;
    }
    main {
        grid-row: 2;
        margin: 0.8em;
    }

    header.banner img {
        width: 4rem;
        height: 4rem;
    }
    header.banner h1 {
        font-size: 1.6rem;
    }
}