/**
 * ShipTea Cruise Port Page Styles
 *
 * Covers: Report Card, port stats, parking tables, weather chart,
 * ship tables, sub-navigation, archive grid, and grade badges.
 */

/* ── Container ── */
.stcdb-port-wrapper {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
}

.stcdb-port-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ── Breadcrumb ── */
.stcdb-port-breadcrumb {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}

.stcdb-port-breadcrumb a {
    color: #0077B6;
    text-decoration: none;
}

.stcdb-port-breadcrumb a:hover {
    text-decoration: underline;
}

.stcdb-port-breadcrumb-sep {
    margin: 0 6px;
    color: #999;
}

/* ── Header ── */
.stcdb-port-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #eee;
}

.stcdb-port-header-text {
    flex: 1;
}

.stcdb-port-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.stcdb-port-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stcdb-port-tag-type {
    background: #E3F2FD;
    color: #0077B6;
}

.stcdb-port-tag-region {
    background: #FFF3E0;
    color: #E65100;
}

.stcdb-port-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 4px;
    line-height: 1.2;
    color: #023E73;
}

.stcdb-port-location {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* ── Grade Badge ── */
.stcdb-port-grade-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 16px;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stcdb-port-grade-letter {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stcdb-port-grade-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    opacity: 0.9;
}

/* ── Sub-navigation ── */
.stcdb-port-subnav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 28px;
    border-bottom: 2px solid #eee;
    -webkit-overflow-scrolling: touch;
}

.stcdb-port-subnav-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.stcdb-port-subnav-link:hover {
    background: #f5f5f5;
    color: #0077B6;
}

.stcdb-port-subnav-active {
    color: #0077B6;
    border-bottom: 3px solid #0077B6;
    margin-bottom: -2px;
}

/* ── Sections ── */
.stcdb-port-section {
    margin-bottom: 36px;
}

.stcdb-port-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #023E73;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0077B6;
}

/* ── Report Card Score Bars ── */
.stcdb-port-scores {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stcdb-port-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stcdb-port-score-label {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.stcdb-port-score-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.stcdb-port-score-weight {
    font-size: 0.7rem;
    color: #999;
}

.stcdb-port-score-bar-wrap {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.stcdb-port-score-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.stcdb-port-score-value {
    width: 60px;
    flex-shrink: 0;
    text-align: right;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
}

.stcdb-port-score-grade {
    font-size: 0.95rem;
    font-weight: 800;
}

.stcdb-port-score-num {
    font-size: 0.75rem;
    color: #999;
}

/* ── Port Stats Grid ── */
.stcdb-port-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.stcdb-port-stat {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stcdb-port-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0077B6;
    line-height: 1.2;
}

.stcdb-port-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Editorial Content ── */
.stcdb-port-editorial {
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
}

.stcdb-port-editorial p {
    margin-bottom: 1em;
}

.stcdb-port-editorial ul,
.stcdb-port-editorial ol {
    margin: 0 0 1em 1.5em;
}

.stcdb-port-tips-section {
    background: #f0f9ff;
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid #0077B6;
}

.stcdb-port-secrets-section {
    background: #fff8f0;
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid #FF6B35;
}

.stcdb-port-tips-section .stcdb-port-section-title {
    border-bottom: none;
    padding-bottom: 0;
}

.stcdb-port-secrets-section .stcdb-port-section-title {
    border-bottom: none;
    border-color: #FF6B35;
    padding-bottom: 0;
    color: #c44d22;
}

/* ── Tables (Parking, Weather, Ships, Budget) ── */
.stcdb-port-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stcdb-port-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stcdb-port-table th {
    background: #023E73;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stcdb-port-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.stcdb-port-table tbody tr:hover {
    background: #f8f9fa;
}

.stcdb-port-table-price {
    font-weight: 700;
    color: #0077B6;
}

.stcdb-port-table-score {
    font-weight: 700;
}

.stcdb-port-table a {
    color: #0077B6;
    text-decoration: none;
    font-weight: 600;
}

.stcdb-port-table a:hover {
    text-decoration: underline;
}

/* ── Cruise Line Badges ── */
.stcdb-port-cruise-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stcdb-port-cruise-line-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f4f8;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

a.stcdb-port-cruise-line-badge:hover {
    background: #0077B6;
    color: #fff;
}

/* ── CTA ── */
.stcdb-port-cta {
    background: linear-gradient(135deg, #023E73 0%, #0077B6 100%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    color: #fff;
    margin-top: 40px;
}

.stcdb-port-cta p {
    font-size: 1.1rem;
    margin: 0 0 16px;
    opacity: 0.9;
}

.stcdb-port-cta-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.stcdb-port-cta-link {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    background: #fff;
    color: #023E73;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stcdb-port-cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stcdb-port-cta-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stcdb-port-cta-outline:hover {
    border-color: #fff;
}

/* ══════════════════════════════════════
   Archive Page Styles
   ══════════════════════════════════════ */

.stcdb-port-archive-header {
    text-align: center;
    margin-bottom: 32px;
}

.stcdb-port-archive-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #023E73;
    margin: 0 0 8px;
}

.stcdb-port-archive-subtitle {
    font-size: 1.05rem;
    color: #666;
    margin: 0;
}

/* ── Filters ── */
.stcdb-port-filters {
    margin-bottom: 28px;
}

.stcdb-port-filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.stcdb-port-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stcdb-port-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.stcdb-port-filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 160px;
}

.stcdb-port-filter-btn {
    padding: 8px 20px;
    background: #0077B6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.stcdb-port-filter-btn:hover {
    background: #005a8c;
}

.stcdb-port-filter-clear {
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
}

.stcdb-port-filter-clear:hover {
    color: #333;
}

/* ── Port Grid (Archive) ── */
.stcdb-port-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.stcdb-port-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stcdb-port-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stcdb-port-card-thumb {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.stcdb-port-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stcdb-port-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.stcdb-port-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.stcdb-port-card-info {
    flex: 1;
}

.stcdb-port-card-type {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0077B6;
}

.stcdb-port-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2px 0 0;
    color: #023E73;
    line-height: 1.3;
}

.stcdb-port-card-location {
    font-size: 0.8rem;
    color: #888;
}

.stcdb-port-card-grade {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stcdb-port-card-grade-letter {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
}

.stcdb-port-card-region {
    font-size: 0.75rem;
    color: #999;
}

.stcdb-port-card-excerpt {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* ── Empty State ── */
.stcdb-port-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.stcdb-port-empty a {
    color: #0077B6;
    font-weight: 600;
}

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .stcdb-port-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stcdb-port-grade-badge {
        width: 100%;
        height: auto;
        flex-direction: row;
        gap: 12px;
        padding: 16px;
        border-radius: 12px;
    }

    .stcdb-port-grade-letter {
        font-size: 1.8rem;
    }

    .stcdb-port-grade-label {
        font-size: 0.8rem;
        margin-top: 0;
    }

    .stcdb-port-title {
        font-size: 1.5rem;
    }

    .stcdb-port-score-row {
        flex-wrap: wrap;
    }

    .stcdb-port-score-label {
        width: 100%;
    }

    .stcdb-port-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stcdb-port-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .stcdb-port-filter-group select {
        min-width: 100%;
    }

    .stcdb-port-grid {
        grid-template-columns: 1fr;
    }

    .stcdb-port-archive-title {
        font-size: 1.6rem;
    }

    .stcdb-port-cta {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .stcdb-port-container {
        padding: 12px;
    }

    .stcdb-port-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stcdb-port-stat {
        padding: 12px;
    }

    .stcdb-port-stat-value {
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════════════════
   PORT RANKINGS PAGE
   ═══════════════════════════════════════════════════ */

.stcdb-port-rankings-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.stcdb-port-rankings-header {
    text-align: center;
    margin-bottom: 24px;
}

.stcdb-port-rankings-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #023E73;
    margin: 0 0 8px;
    line-height: 1.2;
}

.stcdb-port-rankings-header p {
    font-size: 0.92rem;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Hide columns on mobile */
@media (max-width: 768px) {
    .stcdb-port-col-hide-mobile {
        display: none;
    }

    .stcdb-port-rankings-header h1 {
        font-size: 1.4rem;
    }

    .stcdb-port-rankings-wrapper {
        padding: 16px 12px 32px;
    }
}
