/* Sailinks - Nautical Marine Directory Styles */

:root {
    --navy: #1a365d;
    --navy-dark: #0d1b2a;
    --navy-light: #2c5282;
    --ocean: #2b6cb0;
    --ocean-light: #4299e1;
    --sky: #bee3f8;
    --sky-light: #e0f4ff;
    --sand: #f7f4ef;
    --sand-dark: #e8e1d5;
    --white: #ffffff;
    --grey-100: #f7fafc;
    --grey-200: #edf2f7;
    --grey-300: #e2e8f0;
    --grey-400: #cbd5e0;
    --grey-500: #a0aec0;
    --grey-600: #718096;
    --grey-700: #4a5568;
    --grey-800: #2d3748;
    --text: #2d3748;
    --text-light: #4a5568;
    --text-muted: #718096;
    --error: #c53030;
    --success: #2f855a;
    --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--sand);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--navy);
    line-height: 1.3;
    margin-top: 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--ocean);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--navy);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--sky);
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: bold;
    letter-spacing: -0.02em;
}

.logo-tagline {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--white);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 5px 0;
    transition: 0.3s;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--white);
    font-weight: 500;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.nav-link:hover,
.nav-item.active > .nav-link {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    text-decoration: none;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--grey-200);
}

.nav-dropdown a:last-child {
    border-bottom: none;
}

.nav-dropdown a:hover {
    background: var(--sky-light);
    color: var(--navy);
    text-decoration: none;
}

/* Header CTA Button */
.nav-cta {
    margin-left: 0.5rem;
}

.btn-cta {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: var(--white) !important;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.btn-cta:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

/* Main Content */
.site-main {
    min-height: 60vh;
    padding: 3rem 0;
}

/* Hero Section with Image */
.hero-banner {
    position: relative;
    width: 100%;
    height: 500px;
    margin: -3rem 0 3rem 0;
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-banner picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Fallback hero without image */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--ocean) 100%);
    color: var(--white);
    padding: 4rem 0;
    margin: -3rem 0 3rem 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.hero-image {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .hero-banner {
        height: 300px;
        margin: -3rem 0 2rem 0;
    }
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--grey-200);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--ocean);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.category-card h3 a {
    color: var(--navy);
}

.category-card h3 a:hover {
    color: var(--ocean);
}

.category-count {
    display: inline-block;
    background: var(--sky-light);
    color: var(--ocean);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Listings */
.listings-grid {
    display: grid;
    gap: 1.5rem;
}

.listing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--ocean);
}

.listing-card:hover {
    box-shadow: var(--shadow-lg);
}

.listing-name {
    color: var(--navy);
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
}

.listing-name .former-name {
    font-weight: normal;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.listing-description {
    color: var(--text);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.listing-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.listing-details p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listing-details a {
    color: var(--ocean);
}

.listing-website a::before {
    content: "🌐 ";
}

.listing-phone a::before {
    content: "📞 ";
}

.listing-email a::before {
    content: "✉️ ";
}

.listing-address::before {
    content: "📍 ";
}

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 1.5rem 0;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--grey-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--ocean);
}

.search-button,
.btn {
    padding: 0.75rem 1.5rem;
    background: var(--ocean);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-button:hover,
.btn:hover {
    background: var(--navy);
}

.btn-secondary {
    background: var(--grey-200);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--grey-300);
}

/* Blog */
.post-list {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card h3 {
    margin: 0 0 0.75rem 0;
}

.post-card h3 a {
    color: var(--navy);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.post-excerpt {
    color: var(--text-light);
}

/* Single Post */
.post-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.post-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.post-content h2 {
    margin-top: 2rem;
}

.post-content p {
    margin: 1rem 0;
}

.post-content ul, .post-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin: 0.5rem 0;
}

/* Contact Form */
.contact-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--grey-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--ocean);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    background: #c6f6d5;
    color: var(--success);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

/* Form Validation Styles */
.required-legend {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.required-legend .required-marker {
    color: var(--error);
    font-weight: bold;
}

.field-error {
    border-color: var(--error) !important;
    background-color: #fff5f5 !important;
}

.field-error:focus {
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.2);
}

.field-error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin: 0.375rem 0 0 0;
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
}

.error-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-summary {
    background: #fff5f5;
    border: 2px solid var(--error);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.error-summary:focus {
    outline: 3px solid var(--ocean);
    outline-offset: 2px;
}

.error-summary h2 {
    color: var(--error);
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
    font-family: var(--font-sans);
}

.error-summary p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
}

.error-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.error-summary li {
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.error-summary a {
    color: var(--error);
    text-decoration: underline;
}

.error-summary a:hover {
    color: var(--navy);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--grey-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

.char-counter {
    display: block;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.char-counter.over-limit {
    color: var(--error);
    font-weight: 600;
}

.honeypot {
    position: absolute;
    left: -9999px;
}

/* Sidebar */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ocean);
}

.sidebar-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-widget li {
    margin: 0.5rem 0;
}

.sidebar-widget a {
    color: var(--text);
    display: block;
    padding: 0.25rem 0;
}

.sidebar-widget a:hover {
    color: var(--ocean);
}

/* Footer */
.site-footer {
    background: var(--navy-dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem 0;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin: 0.5rem 0;
}

.footer-col a {
    color: var(--grey-400);
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--white);
    text-decoration: none;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: var(--grey-500);
    font-size: 0.875rem;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--ocean);
    margin: 0;
}

.error-page h2 {
    margin-top: 0;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--ocean);
}

.breadcrumbs span {
    margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--navy-dark);
        flex-direction: column;
        padding: 4rem 1rem 1rem;
        transition: right 0.3s ease;
        z-index: 1001;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255,255,255,0.1);
        display: none;
    }
    
    .nav-item.open .nav-dropdown {
        display: block;
    }
    
    .nav-dropdown a {
        color: var(--white);
        border-bottom-color: rgba(255,255,255,0.1);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .header-inner {
        flex-wrap: wrap;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* Print */
@media print {
    .site-header,
    .site-footer,
    .search-form,
    .cookie-banner {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .listing-card,
    .post-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy);
    color: var(--white);
    padding: 1.25rem;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.cookie-banner-content p {
    margin: 0;
    flex: 1 1 400px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner-content p strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.cookie-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    border: 2px solid var(--ocean);
    background: var(--ocean);
    color: var(--white);
    cursor: pointer;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.cookie-btn:hover,
.cookie-btn:focus {
    background: var(--ocean-dark);
    border-color: var(--ocean-dark);
    outline: none;
}

.cookie-btn:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.cookie-btn-secondary {
    background: transparent;
    border-color: var(--white);
    color: var(--white);
}

.cookie-btn-secondary:hover,
.cookie-btn-secondary:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
}

.cookie-policy-link {
    color: var(--grey-300);
    font-size: 0.85rem;
    text-decoration: underline;
}

.cookie-policy-link:hover {
    color: var(--white);
}

.cookie-settings-link {
    color: var(--grey-400);
}

.cookie-settings-link:hover {
    color: var(--white);
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-content p {
        flex: none;
    }
    
    .cookie-banner-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1 1 auto;
        min-width: 120px;
    }
}
