Files
Vesmir/css/style.css
T
2026-06-26 12:08:13 +02:00

332 lines
7.3 KiB
CSS

/* ==========================================================================
1. RESET A ZÁKLADNÍ NASTAVENÍ (Box-sizing podle zadání)
========================================================================== */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
/* Barevná paleta - Vesmírný temný režim s vysokým kontrastem */
--bg-space: #0b0d17;
--bg-card: #151926;
--text-main: #f0f2f5;
--text-muted: #b0b5c1;
--accent-blue: #4f46e5;
--accent-cyan: #06b6d4;
--white: #ffffff;
/* Typografie */
--font-primary: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
html {
scroll-behavior: smooth;
font-size: 16px;
}
body {
font-family: var(--font-primary);
background-color: var(--bg-space);
color: var(--text-main);
line-height: 1.6;
}
/* Pomocný kontejner pro zarovnání obsahu */
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* Přístupnost: Skrytí prvku pro běžné oči, ale čitelné pro čtečky obrazovky */
.sr-only-skip {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
.sr-only-skip:focus {
position: static;
width: auto;
height: auto;
background: var(--accent-cyan);
color: var(--bg-space);
padding: 10px;
display: block;
text-align: center;
font-weight: bold;
}
/* Klávesnicový focus pro lepší přístupnost (WCAG) */
a:focus, button:focus, input:focus {
outline: 3px solid var(--accent-cyan);
outline-offset: 2px;
}
/* ==========================================================================
2. HLAVIČKA A NAVIGACE (Flexbox)
========================================================================== */
.main-header {
background-color: rgba(21, 25, 38, 0.9);
backdrop-filter: blur(10px);
position: sticky;
top: 0;
z-index: 100;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.header-wrapper {
display: flex;
flex-direction: column; /* Mobile first: pod sebou */
align-items: center;
padding: 15px 20px;
}
.logo a {
font-size: 1.4rem;
font-weight: bold;
color: var(--white);
text-decoration: none;
}
.main-nav {
margin-top: 15px;
}
.main-nav ul {
display: flex;
list-style: none;
gap: 20px;
}
.main-nav a {
color: var(--text-muted);
text-decoration: none;
font-weight: 500;
transition: color 0.3s ease;
padding: 5px 10px;
}
.main-nav a:hover, .main-nav a.active {
color: var(--accent-cyan);
}
/* ==========================================================================
3. HERO SEKCE (Úvodní banner)
========================================================================== */
.hero-section {
padding: 80px 0;
text-align: center;
background: radial-gradient(circle at center, #1e1b4b 0%, var(--bg-space) 70%);
}
.hero-content h1 {
font-size: 2.5rem;
color: var(--white);
margin-bottom: 20px;
line-height: 1.2;
}
.hero-content p {
font-size: 1.1rem;
color: var(--text-muted);
max-width: 600px;
margin: 0 auto 30px auto;
}
/* Tlačítka */
.btn {
display: inline-block;
padding: 12px 28px;
border-radius: 8px;
font-weight: 600;
text-decoration: none;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
border: none;
}
.btn-primary {
background-color: var(--accent-blue);
color: var(--white);
}
.btn-primary:hover {
background-color: #4338ca;
transform: translateY(-2px);
}
.btn-secondary {
background-color: transparent;
border: 2px solid var(--accent-cyan);
color: var(--accent-cyan);
width: 100%;
}
.btn-secondary:hover {
background-color: var(--accent-cyan);
color: var(--bg-space);
}
/* ==========================================================================
4. ENCYKLOPEDIE PLANET (CSS Grid - Mobile First)
========================================================================== */
.planets-section {
padding: 60px 0;
}
.planets-section h2, .calculator-section h2 {
font-size: 2rem;
text-align: center;
color: var(--white);
margin-bottom: 10px;
}
.section-subtitle {
text-align: center;
color: var(--text-muted);
margin-bottom: 40px;
}
/* CSS Grid definice pro karty */
.planets-grid {
display: grid;
grid-template-columns: 1fr; /* Na mobilu 1 sloupec */
gap: 30px;
}
.planet-card {
background-color: var(--bg-card);
border-radius: 12px;
overflow: hidden;
border: 1px solid rgba(255, 255, 255, 0.05);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.planet-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(6, 182, 212, 0.1);
}
.planet-card img {
width: 100%;
height: 250px;
object-fit: cover; /* Aby se obrázek nedeformoval */
background-color: #000; /* fallback než se načte obrázek */
}
.card-body {
padding: 25px;
}
.card-body h3 {
font-size: 1.5rem;
color: var(--white);
margin-bottom: 10px;
}
.card-body p {
color: var(--text-muted);
margin-bottom: 20px;
font-size: 0.95rem;
}
/* ==========================================================================
5. KALKULAČKA (Flexbox / Form styling)
========================================================================== */
.calculator-section {
padding: 60px 0;
background-color: rgba(21, 25, 38, 0.5);
}
.calculator-wrapper {
max-width: 600px;
margin: 0 auto;
}
.calc-form {
margin-top: 30px;
display: flex;
flex-direction: column;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.form-group label {
font-weight: 500;
color: var(--text-main);
}
.form-group input {
padding: 12px;
border-radius: 8px;
border: 2px solid rgba(255, 255, 255, 0.1);
background-color: var(--bg-space);
color: var(--white);
font-size: 1rem;
}
.calc-result {
margin-top: 30px;
padding: 20px;
border-radius: 8px;
background-color: var(--bg-card);
border-left: 4px solid var(--accent-cyan);
min-height: 50px;
}
/* ==========================================================================
6. PATIČKA
========================================================================== */
.main-footer {
padding: 40px 0;
border-top: 1px solid rgba(255, 255, 255, 0.05);
text-align: center;
color: var(--text-muted);
font-size: 0.9rem;
}
.footer-wrapper p + p {
margin-top: 5px;
}
/* ==========================================================================
7. RESPONSIVE DESIGN (Média dotazy pro Tablet a Desktop)
========================================================================== */
/* Tablet a širší (nad 600px) */
@media (min-width: 600px) {
.header-wrapper {
flex-direction: row; /* Navigace a logo vedle sebe */
justify-content: space-between;
}
.main-nav {
margin-top: 0;
}
.planets-grid {
grid-template-columns: repeat(2, 1fr); /* 2 karty vedle sebe */
}
.hero-content h1 {
font-size: 3.5rem;
}
}
/* Velký desktop (nad 900px) */
@media (min-width: 900px) {
.planets-grid {
grid-template-columns: repeat(3, 1fr); /* 3 karty vedle sebe */
}
}