Fix mobile responsiveness with dynamic viewport units and fluid typography
All checks were successful
build-website / build (push) Successful in 1m32s

- Implement dynamic viewport units (dvh) for proper mobile scaling
- Add fluid typography using clamp() functions
- Fix iOS-specific viewport issues with -webkit-fill-available
- Add scroll-margin-top to prevent section overlaps
- Improve touch targets to 50px minimum for mobile UX
- Add CSS custom properties for consistent responsive spacing
- Fix hero section to properly fill mobile viewport
- Update service cards for better mobile layout
This commit is contained in:
2025-09-19 01:39:19 +02:00
parent 1211b67642
commit 5024fc5385
3 changed files with 134 additions and 37 deletions

View File

@@ -8,11 +8,17 @@ html {
scroll-behavior: smooth;
overscroll-behavior-y: contain;
-webkit-overflow-scrolling: touch;
/* Proper iOS viewport handling */
height: -webkit-fill-available;
}
body {
overscroll-behavior-y: contain;
-webkit-overflow-scrolling: touch;
min-height: 100vh;
min-height: -webkit-fill-available;
/* Prevent double-tap zoom on mobile */
touch-action: manipulation;
}
/* Accessibility: Reduced Motion */
@@ -50,6 +56,25 @@ body {
/* Gradients */
--gradient-warm: linear-gradient(135deg, #b48b4e 0%, #c9a56f 100%);
--gradient-blue: linear-gradient(135deg, #001f3f 0%, #1e3a5f 100%);
/* Responsive Spacing Scale */
--space-xs: clamp(0.5rem, 2vw, 0.75rem);
--space-sm: clamp(1rem, 3vw, 1.5rem);
--space-md: clamp(1.5rem, 4vw, 2rem);
--space-lg: clamp(2rem, 5vw, 3rem);
--space-xl: clamp(3rem, 6vw, 4rem);
--space-2xl: clamp(4rem, 8vw, 6rem);
/* Fluid Typography */
--text-xs: clamp(0.75rem, 2vw, 0.875rem);
--text-sm: clamp(0.875rem, 2.5vw, 1rem);
--text-base: clamp(1rem, 2.5vw, 1.125rem);
--text-lg: clamp(1.125rem, 3vw, 1.25rem);
--text-xl: clamp(1.25rem, 3.5vw, 1.5rem);
--text-2xl: clamp(1.5rem, 4vw, 1.875rem);
--text-3xl: clamp(1.875rem, 5vw, 2.25rem);
--text-4xl: clamp(2.25rem, 6vw, 3rem);
--text-5xl: clamp(3rem, 7vw, 3.75rem);
}
}
@@ -221,6 +246,7 @@ body {
/* Hero Section */
.hero-video-container {
@apply absolute inset-0 w-full h-full overflow-hidden;
will-change: transform;
}
.hero-overlay {
@@ -239,26 +265,32 @@ body {
@media (max-width: 768px) {
.hero-logo img {
height: auto;
width: 85%;
max-width: 340px;
max-height: 200px;
width: clamp(260px, 80vw, 360px);
max-height: clamp(160px, 45vw, 220px);
margin: 0 auto;
object-fit: contain;
}
/* Proper hero sizing on mobile */
.hero-content {
padding: 20px;
padding: var(--space-sm);
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
/* Ensure touch targets are at least 48px for better mobile UX */
button, .btn-primary-warm, .btn-secondary-warm {
min-height: 48px;
min-width: 48px;
min-height: 50px;
min-width: 50px;
font-size: var(--text-base);
padding: 14px clamp(20px, 5vw, 32px);
width: 100%;
max-width: 340px;
}
}

View File

@@ -1665,17 +1665,21 @@ html {
.hero-voyage {
padding: 0;
min-height: 100vh;
min-height: 100dvh;
height: 100vh;
height: 100dvh;
}
.hero-content {
padding: 15px;
padding: clamp(1rem, 4vw, 2rem);
overflow-x: hidden;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
min-height: 100dvh;
}
/* Responsive logo */
@@ -1687,49 +1691,50 @@ html {
.hero-logo img {
height: auto;
width: 90%;
max-width: 340px;
max-height: 200px;
width: clamp(280px, 85vw, 380px);
max-height: clamp(180px, 50vw, 240px);
margin: 0 auto;
object-fit: contain;
}
.hero-headline {
font-size: 2.25rem;
line-height: 1.2;
margin-bottom: 1rem;
padding: 0 10px;
font-size: clamp(2rem, 7vw, 2.5rem);
line-height: 1.15;
margin-bottom: var(--space-sm);
padding: 0 var(--space-xs);
}
.hero-subtext {
font-size: 1rem;
padding: 0 10px;
margin-bottom: 2rem;
line-height: 1.5;
font-size: clamp(0.95rem, 2.5vw, 1.125rem);
padding: 0 var(--space-sm);
margin-bottom: var(--space-md);
line-height: 1.6;
text-align: center;
max-width: 90%;
}
.hero-actions {
flex-direction: column;
width: 100%;
padding: 0 15px;
gap: 12px;
padding: 0 var(--space-sm);
gap: var(--space-sm);
align-items: center;
max-width: 380px;
}
/* Smaller buttons on mobile */
.btn-primary-warm,
.btn-secondary-warm {
width: 100%;
max-width: 340px;
padding: 14px 24px;
font-size: 1rem;
max-width: 360px;
padding: clamp(14px, 3vw, 18px) clamp(24px, 5vw, 32px);
font-size: clamp(1rem, 2.5vw, 1.125rem);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
gap: 0.5rem;
min-height: 50px;
min-height: 52px;
}
.btn-primary-warm .btn-icon,
@@ -1741,9 +1746,9 @@ html {
}
.trust-badge {
padding: 0.4rem 1rem;
font-size: 0.8rem;
margin-bottom: 1.5rem;
padding: var(--space-xs) var(--space-sm);
font-size: clamp(0.8rem, 2vw, 0.9rem);
margin-bottom: var(--space-md);
}
.scroll-indicator {
@@ -1752,7 +1757,10 @@ html {
/* Fix all section padding for mobile */
section {
padding: 40px 15px !important;
padding: var(--space-xl) var(--space-sm) !important;
scroll-margin-top: 80px;
position: relative;
z-index: 2;
}
.welcome-section,
@@ -1760,7 +1768,8 @@ html {
.experience-stories,
.portfolio-gallery,
.booking-cta {
padding: 40px 15px !important;
padding: var(--space-xl) var(--space-sm) !important;
margin-top: -1px; /* Prevent gaps between sections */
}
.welcome-content {
@@ -1770,15 +1779,47 @@ html {
.service-card {
width: 100%;
padding: 20px;
padding: var(--space-sm);
}
.services-grid {
grid-template-columns: 1fr;
gap: 20px;
gap: var(--space-md);
padding: 0;
}
/* Fix service card content */
.service-content {
padding: var(--space-sm);
}
.service-features li {
display: flex;
align-items: flex-start;
gap: var(--space-xs);
padding: var(--space-xs) 0;
}
.service-features li::before {
flex-shrink: 0;
margin-top: 2px;
}
/* Section titles for mobile */
.section-title {
font-size: clamp(1.75rem, 6vw, 2.25rem);
line-height: 1.2;
margin-bottom: var(--space-sm);
padding: 0 var(--space-xs);
}
.section-subtitle {
font-size: clamp(0.95rem, 2.5vw, 1.125rem);
line-height: 1.5;
margin-bottom: var(--space-md);
padding: 0 var(--space-xs);
}
.yacht-card {
grid-template-columns: 1fr;
}

View File

@@ -495,6 +495,16 @@ html {
.stars {
color: var(--warm-yellow);
font-size: 1rem;
display: inline-flex;
gap: 2px;
}
/* Ensure stars icons display horizontally */
.stars i,
.story-content .stars i,
.testimonial-highlight .stars i {
display: inline-block;
margin-right: 2px;
}
.hero-headline {
@@ -1341,18 +1351,22 @@ html {
.btn-booking {
width: 100%;
padding: 0.75rem 1.5rem;
background: rgba(255, 255, 255, 0.2);
color: var(--white);
background: var(--white);
color: var(--primary-blue);
border: 2px solid var(--white);
border-radius: 50px;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
opacity: 1;
visibility: visible;
}
.btn-booking:hover {
background: var(--white);
color: var(--primary-blue);
background: var(--gradient-warm);
color: var(--white);
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.btn-booking.primary {
@@ -1380,12 +1394,22 @@ html {
}
.footer-content {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
display: flex;
justify-content: space-between;
gap: var(--space-2xl);
margin-bottom: var(--space-lg);
}
.footer-brand {
flex: 1;
max-width: 500px;
}
.footer-contact {
flex: 0 0 auto;
margin-left: auto;
}
.footer-brand h3 {
font-family: var(--font-display);
font-size: 2rem;