/* ferryschedule.id — style.css */
:root {
    --primary: #0066cc;
    --primary-dark: #004c99;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #1a1a2e;
    --muted: #6c757d;
    --border: #dee2e6;
    --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: rgba(255,255,255,.9); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: #fff; text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { color: var(--muted); margin-bottom: 24px; }
.country-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.country-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px 16px; text-decoration: none; color: var(--text);
    transition: box-shadow .15s, transform .15s;
}
.country-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.country-card .flag { font-size: 2rem; }
.country-card .cname { font-weight: 600; }
.country-card .cstats { font-size: .85rem; color: var(--muted); }

/* Route grid */
.popular-routes { padding: 20px 0; }
.popular-routes h2, .seo-content h2 { margin-bottom: 16px; }
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.route-card {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; text-decoration: none; color: var(--text);
    transition: box-shadow .15s;
}
.route-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.route-name { font-weight: 600; font-size: .95rem; }
.route-op { font-size: .82rem; color: var(--muted); }

/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Country page */
.country-hero { padding: 10px 0 24px; }
.country-hero h1 { font-size: 1.8rem; }
.country-hero p { color: var(--muted); }
.routes-list { padding-bottom: 20px; }
.route-table { display: flex; flex-direction: column; gap: 4px; }
.route-row {
    display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; text-decoration: none; color: var(--text);
}
.route-row:hover { background: #f0f6ff; }
.r-name { font-weight: 600; }
.r-op { font-size: .82rem; color: var(--muted); }
.r-dur { font-size: .82rem; color: var(--primary); white-space: nowrap; }

/* Route detail */
.route-detail { padding: 10px 0 40px; }
.route-detail h1 { font-size: 1.6rem; margin-bottom: 12px; }
.route-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.op-link { margin-bottom: 20px; }
.op-link a { color: var(--primary); }
.schedule { margin: 24px 0; }
.schedule h2 { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f0f0f0; font-weight: 600; font-size: .85rem; }
td { font-size: .9rem; }
tr:hover td { background: #f8fafc; }

/* Map */
.route-map { margin: 24px 0; }
.route-map h2 { margin-bottom: 12px; }
.map-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Terminals */
.terminals { margin: 24px 0; }
.terminals h2 { margin-bottom: 12px; }
.stop-list { display: flex; flex-direction: column; gap: 6px; }
.stop-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 16px;
}
.stop-name { font-weight: 600; font-size: .9rem; }
.stop-coords { font-size: .78rem; color: var(--muted); }

/* SEO content */
.seo-content { margin: 30px 0; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.seo-content h2 { margin-bottom: 12px; font-size: 1.2rem; }
.seo-content p { margin-bottom: 12px; color: #333; font-size: .92rem; }

/* Operators */
.operators-section { margin: 24px 0; }
.operators-section h2 { margin-bottom: 12px; }
.op-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.op-list li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; font-size: .9rem; }

/* Search */
.search-page { padding: 20px 0 40px; }
.search-form { display: flex; gap: 10px; margin-bottom: 20px; }
.search-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.search-form button { padding: 10px 24px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 1rem; }
.search-form button:hover { background: var(--primary-dark); }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-results > p { margin-bottom: 8px; color: var(--muted); }

/* Static pages */
.static-page { padding: 10px 0 40px; max-width: 800px; }
.static-page h1 { margin-bottom: 20px; }
.static-page h2 { margin: 20px 0 10px; }
.static-page p { margin-bottom: 12px; }
.static-page ul { margin: 0 0 12px 20px; }

/* Footer */
.site-footer {
    background: #1a1a2e; color: rgba(255,255,255,.7); padding: 30px 0; margin-top: 40px;
    font-size: .85rem;
}
.site-footer p { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.5rem; }
    .country-cards { grid-template-columns: repeat(2, 1fr); }
    .route-grid { grid-template-columns: 1fr; }
    .route-row { grid-template-columns: 1fr; gap: 4px; }
    .site-header .container { flex-direction: column; }
    .site-header nav { justify-content: center; }
}

/* ===== Route detail: new section order (map first) ===== */
.route-map-section { margin: 20px 0; }
.route-map-section h2 { margin-bottom: 12px; font-size: 1.3rem; }
.map-container { height: 450px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; z-index: 0; background: #e8e8e8; }
.map-container .leaflet-pane,
.map-container .leaflet-top,
.map-container .leaflet-bottom { z-index: 1; }
.map-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }

.schedule-section, .fares-section, .vessels-section, .facilities-section, .terminals-section {
    margin: 28px 0;
}
.schedule-section h2, .fares-section h2, .vessels-section h2, .facilities-section h2, .terminals-section h2 {
    margin-bottom: 14px; font-size: 1.3rem;
}
.table-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Fares */
.fare-table table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.fare-table th, .fare-table td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.fare-table th { background: #f0f6ff; font-weight: 600; font-size: .85rem; }
.fare-table td { font-size: .92rem; }
.fare-table tr:last-child td { border-bottom: none; }
.fare-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Schedule: scroll-capped feed (all rows stay in HTML, hidden ones display:none) */
.table-cap {
    max-height: min(72vh, 560px);
    overflow-y: auto;
    position: relative;
}
.table-cap table { position: relative; }
.table-cap thead th {
    position: sticky; top: 0; z-index: 5;
    background: #f0f6ff;
    box-shadow: 0 1px 0 var(--border);
}
.sched-more {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-top: 10px;
}
.sched-count { font-size: .82rem; color: var(--muted); }
.sched-btn {
    padding: 7px 18px; font-size: .85rem;
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius); cursor: pointer;
}
.sched-btn:hover { background: var(--primary-dark); }

/* Vessels */
.vessel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.vessel-item {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px;
}
.vlabel { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.vval { font-weight: 600; font-size: .95rem; }

/* Facilities */
.facility-list { display: flex; flex-direction: column; gap: 10px; }
.facility-item {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px;
}
.facility-item strong { display: block; margin-bottom: 8px; font-size: .92rem; }
.facility-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.facility-tag {
    font-size: .8rem; background: #f0f6ff; border: 1px solid #cce0ff;
    border-radius: 20px; padding: 3px 12px; white-space: nowrap;
}

@media (max-width: 768px) {
    .map-container { height: 320px; }
    .vessel-grid { grid-template-columns: 1fr; }
}
