Files
webprogrammierung/css/main.css
T
caroschulte02-alt 45924e6cfb First Implementation
2026-05-13 01:12:25 +02:00

320 lines
4.5 KiB
CSS

/* =========================
Modernes Responsive Design
========================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
/* Farbpalette */
--primary: #2563eb;
--primary-dark: #1d4ed8;
--background: #f5f7fb;
--surface: #ffffff;
--text: #1e293b;
--text-light: #64748b;
--border: #e2e8f0;
/* Schatten */
--shadow: 0 8px 25px rgba(0,0,0,0.08);
/* Rundungen */
--radius: 16px;
}
body {
font-family: "Segoe UI", Arial, sans-serif;
background: var(--background);
color: var(--text);
line-height: 1.6;
}
/* =========================
Header
========================= */
header {
background: var(--surface);
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
position: sticky;
top: 0;
z-index: 1000;
}
.header-container {
max-width: 1200px;
margin: auto;
padding: 16px 24px;
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
}
/* Logo */
.logo {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary);
}
/* =========================
Navigation
========================= */
nav ul {
list-style: none;
display: flex;
align-items: center;
gap: 18px;
}
nav a {
text-decoration: none;
color: var(--text);
font-weight: 500;
transition: 0.25s ease;
padding: 8px 14px;
border-radius: 10px;
}
nav a:hover,
nav a:focus {
background: #eff6ff;
color: var(--primary);
}
/* =========================
Suchfeld
========================= */
.search-box {
display: flex;
gap: 10px;
}
.search-box input {
padding: 10px 14px;
border: 1px solid var(--border);
border-radius: 10px;
outline: none;
min-width: 220px;
}
.search-box input:focus {
border-color: var(--primary);
}
/* =========================
Buttons
========================= */
.btn {
padding: 10px 18px;
border-radius: 10px;
text-decoration: none;
font-weight: 600;
transition: 0.25s ease;
border: none;
cursor: pointer;
}
.btn-primary {
background: var(--primary);
color: white;
}
.btn-primary:hover {
background: var(--primary-dark);
}
.btn-secondary {
background: #eff6ff;
color: var(--primary);
}
.btn-secondary:hover {
background: #dbeafe;
}
/* =========================
Hauptbereich
========================= */
main {
max-width: 1200px;
margin: 50px auto;
padding: 0 24px;
}
/* Hero Section */
.hero {
background: linear-gradient(
135deg,
#2563eb,
#3b82f6
);
color: white;
padding: 80px 40px;
border-radius: var(--radius);
text-align: center;
box-shadow: var(--shadow);
margin-bottom: 50px;
}
.hero h1 {
font-size: 3rem;
margin-bottom: 20px;
}
.hero p {
max-width: 800px;
margin: auto;
font-size: 1.1rem;
}
/* =========================
Karten / Inhalte
========================= */
.content-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
}
.card {
background: var(--surface);
border-radius: var(--radius);
padding: 28px;
box-shadow: var(--shadow);
transition: 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
}
.card h2 {
margin-bottom: 14px;
color: var(--primary);
}
.card p {
color: var(--text-light);
}
/* =========================
Footer
========================= */
footer {
margin-top: 80px;
background: var(--surface);
border-top: 1px solid var(--border);
}
.footer-container {
max-width: 1200px;
margin: auto;
padding: 24px;
display: flex;
justify-content: center;
gap: 30px;
flex-wrap: wrap;
}
footer a {
text-decoration: none;
color: var(--text-light);
transition: 0.25s ease;
}
footer a:hover {
color: var(--primary);
}
/* =========================
Accessibility
========================= */
a:focus,
button:focus,
input:focus {
outline: 3px solid #93c5fd;
outline-offset: 2px;
}
/* =========================
Responsive Design
========================= */
/* Tablet */
@media (max-width: 900px) {
.header-container {
flex-direction: column;
align-items: stretch;
}
nav ul {
justify-content: center;
flex-wrap: wrap;
}
.search-box {
justify-content: center;
}
.hero h1 {
font-size: 2.3rem;
}
}
/* Smartphone */
@media (max-width: 600px) {
.hero {
padding: 50px 25px;
}
.hero h1 {
font-size: 2rem;
}
.hero p {
font-size: 1rem;
}
nav ul {
flex-direction: column;
gap: 10px;
}
.search-box {
flex-direction: column;
}
.search-box input {
width: 100%;
min-width: unset;
}
.btn {
width: 100%;
text-align: center;
}
}