|
1 | 1 | /* Full-width alternating section backgrounds for long single-page layouts */ |
2 | 2 |
|
| 3 | +/* ============================================ |
| 4 | + MANUAL SECTIONS (with .section-gray / .section-white classes) |
| 5 | + ============================================ */ |
| 6 | + |
3 | 7 | /* Full-width section wrappers with alternating backgrounds */ |
4 | 8 | .doc .openblock.section-gray, |
5 | 9 | .doc .openblock.section-white { |
|
50 | 54 | padding-top: 3.5rem; |
51 | 55 | padding-bottom: 3.5rem; |
52 | 56 | } |
53 | | -} |
54 | 57 |
|
55 | | -/* ============================================ |
56 | | - Card styling for quoteblocks in sections |
57 | | - ============================================ */ |
| 58 | + /* When no TOC sidebar, reduce section padding to use more space */ |
| 59 | + article.doc:only-child .openblock.section-gray, |
| 60 | + article.doc:only-child .openblock.section-white { |
| 61 | + padding-left: calc(50vw - 50% + 0.5rem) !important; |
| 62 | + padding-right: calc(50vw - 50% + 0.5rem) !important; |
| 63 | + } |
| 64 | + /* Note: exampleblock margin removal for no-TOC is handled globally in doc.css */ |
| 65 | +} |
58 | 66 |
|
59 | | -/* Style quoteblocks inside sections as cards */ |
| 67 | +/* Card styling for quoteblocks in manual sections */ |
60 | 68 | .doc .section-gray .quoteblock, |
61 | 69 | .doc .section-white .quoteblock { |
62 | 70 | background: #fff; |
|
68 | 76 | transition: box-shadow 0.2s ease, transform 0.2s ease; |
69 | 77 | } |
70 | 78 |
|
71 | | -.doc .section-gray .quoteblock:hover, |
72 | | -.doc .section-white .quoteblock:hover { |
| 79 | +.doc .section-gray .quoteblock:not(:has(img)):hover, |
| 80 | +.doc .section-white .quoteblock:not(:has(img)):hover { |
73 | 81 | box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); |
74 | 82 | transform: translateY(-2px); |
75 | 83 | } |
|
109 | 117 | margin-bottom: 0.25rem; |
110 | 118 | color: var(--heading-font-color, #262626); |
111 | 119 | } |
| 120 | + |
| 121 | +/* ============================================ |
| 122 | + AUTOMATIC ALTERNATING SECTIONS (for pages with :page-alternating-sections: true) |
| 123 | + ============================================ */ |
| 124 | + |
| 125 | +/* Base styles for automatic alternating sections */ |
| 126 | +.doc > .sect1:nth-child(even), |
| 127 | +.doc > .sect1:nth-child(odd) { |
| 128 | + margin-left: calc(-50vw + 50%); |
| 129 | + margin-right: calc(-50vw + 50%); |
| 130 | + padding-left: calc(50vw - 50% + 1rem); |
| 131 | + padding-right: calc(50vw - 50% + 1rem); |
| 132 | + padding-top: 2rem; |
| 133 | + padding-bottom: 2rem; |
| 134 | + margin-top: 0; |
| 135 | + margin-bottom: 0; |
| 136 | +} |
| 137 | + |
| 138 | +/* Even sections (2, 4, 6, 8...) - gray background */ |
| 139 | +.doc > .sect1:nth-child(even) { |
| 140 | + background-color: #e9ecef; |
| 141 | +} |
| 142 | + |
| 143 | +/* Odd sections (1, 3, 5, 7...) - white background */ |
| 144 | +.doc > .sect1:nth-child(odd) { |
| 145 | + background-color: #fff; |
| 146 | +} |
| 147 | + |
| 148 | +/* Section body and all containers - force full width expansion */ |
| 149 | +.doc > .sect1 .sectionbody, |
| 150 | +.doc > .sect1 .sectionbody > *, |
| 151 | +.doc > .sect1 .sectionbody > * > * { |
| 152 | + max-width: none !important; |
| 153 | + margin-left: 0 !important; |
| 154 | + margin-right: 0 !important; |
| 155 | +} |
| 156 | + |
| 157 | +.doc > .sect1 .sectionbody { |
| 158 | + margin-top: 1rem; |
| 159 | + width: 100%; |
| 160 | +} |
| 161 | + |
| 162 | +/* Grids inside automatic sections - force full width expansion */ |
| 163 | +.doc > .sect1 .exampleblock, |
| 164 | +.doc > .sect1 .exampleblock.grid, |
| 165 | +.doc > .sect1 .exampleblock.grid-2, |
| 166 | +.doc > .sect1 .exampleblock.grid-3 { |
| 167 | + max-width: none !important; |
| 168 | + width: 100% !important; |
| 169 | + margin-left: 0 !important; |
| 170 | + margin-right: 0 !important; |
| 171 | +} |
| 172 | + |
| 173 | +.doc > .sect1 .exampleblock > .content, |
| 174 | +.doc > .sect1 .exampleblock.grid > .content, |
| 175 | +.doc > .sect1 .exampleblock.grid-2 > .content, |
| 176 | +.doc > .sect1 .exampleblock.grid-3 > .content { |
| 177 | + max-width: none !important; |
| 178 | + width: 100% !important; |
| 179 | + margin-left: 0 !important; |
| 180 | + margin-right: 0 !important; |
| 181 | +} |
| 182 | + |
| 183 | +/* Individual cards in automatic sections - maintain nice aspect ratio */ |
| 184 | +.doc > .sect1 .exampleblock .quoteblock { |
| 185 | + max-width: 600px; |
| 186 | + width: 100%; |
| 187 | + justify-self: start; |
| 188 | +} |
| 189 | + |
| 190 | +/* For 3-column grids, smaller max width */ |
| 191 | +.doc > .sect1 .exampleblock.grid-3 .quoteblock { |
| 192 | + max-width: 400px; |
| 193 | +} |
| 194 | + |
| 195 | +/* Desktop adjustments for automatic sections */ |
| 196 | +@media screen and (min-width: 1024px) { |
| 197 | + .doc > .sect1:nth-child(even), |
| 198 | + .doc > .sect1:nth-child(odd) { |
| 199 | + padding-left: calc(50vw - 50% + 2rem); |
| 200 | + padding-right: calc(50vw - 50% + 2rem); |
| 201 | + padding-top: 3rem; |
| 202 | + padding-bottom: 3rem; |
| 203 | + } |
| 204 | + |
| 205 | + /* When no TOC sidebar, optimize for more content space */ |
| 206 | + article.doc:only-child .sect1:nth-child(even), |
| 207 | + article.doc:only-child .sect1:nth-child(odd) { |
| 208 | + padding-left: calc(50vw - 50% + 1rem); |
| 209 | + padding-right: calc(50vw - 50% + 1rem); |
| 210 | + } |
| 211 | + |
| 212 | + /* On desktop, allow cards to be slightly wider */ |
| 213 | + .doc > .sect1 .exampleblock .quoteblock { |
| 214 | + max-width: 700px; |
| 215 | + } |
| 216 | + |
| 217 | + .doc > .sect1 .exampleblock.grid-3 .quoteblock { |
| 218 | + max-width: 450px; |
| 219 | + } |
| 220 | +} |
| 221 | + |
| 222 | +/* Wide screens adjustments */ |
| 223 | +@media screen and (min-width: 1440px) { |
| 224 | + .doc > .sect1:nth-child(even), |
| 225 | + .doc > .sect1:nth-child(odd) { |
| 226 | + padding-left: calc(50vw - 50% + 3rem); |
| 227 | + padding-right: calc(50vw - 50% + 3rem); |
| 228 | + } |
| 229 | + |
| 230 | + /* On wide screens, cards can be even larger */ |
| 231 | + .doc > .sect1 .exampleblock .quoteblock { |
| 232 | + max-width: 800px; |
| 233 | + } |
| 234 | + |
| 235 | + .doc > .sect1 .exampleblock.grid-3 .quoteblock { |
| 236 | + max-width: 500px; |
| 237 | + } |
| 238 | +} |
0 commit comments