/*  ============================================================
    SURF RESULTS — WaveRide-inspired
    Breezy, turquoise-accented, generous whitespace,
    script font for decorative touches, ocean lifestyle.
    ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Pacifico&display=swap');

/* ---- Tokens ---- */
:root {
    --sf-teal:          #20b2aa;
    --sf-teal-dark:     #1a9690;
    --sf-teal-light:    #e6f7f6;
    --sf-teal-glow:     rgba(32,178,170,0.12);
    --sf-amber:         #f0a830;
    --sf-amber-light:   #fef6e6;

    --sf-white:         #ffffff;
    --sf-off-white:     #f9fafb;
    --sf-sand:          #f5f3ef;
    --sf-grey-100:      #f0f0f0;
    --sf-grey-200:      #e2e2e2;
    --sf-grey-300:      #c8c8c8;
    --sf-grey-500:      #888;
    --sf-grey-700:      #4a4a4a;
    --sf-dark:          #1e2a35;
    --sf-ink:           #2c3e50;

    --sf-gold:          #d4a017;
    --sf-silver:        #8c9baa;
    --sf-bronze:        #b87333;

    --sf-font-body:     'Barlow', 'Helvetica Neue', Arial, sans-serif;
    --sf-font-script:   'Pacifico', cursive;

    --sf-radius:        8px;
    --sf-radius-lg:     16px;
    --sf-shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
    --sf-shadow-md:     0 4px 20px rgba(0,0,0,0.08);
    --sf-shadow-hover:  0 8px 30px rgba(0,0,0,0.12);

    --sf-ease:          cubic-bezier(0.25, 0.1, 0.25, 1);
    --sf-speed:         200ms;
}

@media (prefers-reduced-motion: reduce) {
    :root { --sf-speed: 0ms; }
}

/* ---- Base ---- */
.surf-area {
    margin: 0;
    padding: 0;
    background: var(--sf-off-white);
    color: var(--sf-ink);
    font-family: var(--sf-font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.surf-area ::selection {
    background: var(--sf-teal);
    color: white;
}

.surf-area a:focus-visible {
    outline: 2px solid var(--sf-teal);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Masthead ---- */
.sf-masthead {
    background: var(--sf-white);
    border-bottom: 1px solid var(--sf-grey-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sf-masthead__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sf-masthead__brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    text-decoration: none;
}

.sf-masthead__logo {
    font-family: var(--sf-font-script);
    font-size: 1.6rem;
    color: var(--sf-teal);
    line-height: 1;
}

.sf-masthead__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sf-grey-500);
}

.sf-masthead__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.sf-masthead__link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sf-grey-700);
    text-decoration: none;
    transition: color var(--sf-speed) var(--sf-ease);
}

.sf-masthead__link:hover {
    color: var(--sf-teal);
}

/* ---- Hero banner (index page) ---- */
.sf-hero {
    background: linear-gradient(135deg, var(--sf-dark) 0%, #2a4a5e 100%);
    padding: 60px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sf-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(32,178,170,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.sf-hero__script {
    font-family: var(--sf-font-script);
    font-size: 1.1rem;
    color: var(--sf-teal);
    margin: 0 0 8px 0;
    position: relative;
}

.sf-hero__title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--sf-white);
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sf-hero__sub {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255,255,255,0.65);
    margin: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Breadcrumb bar ---- */
.sf-crumb {
    background: var(--sf-white);
    border-bottom: 1px solid var(--sf-grey-200);
    padding: 12px 24px;
}

.sf-crumb__inner {
    max-width: 1100px;
    margin: 0 auto;
    font-size: 0.82rem;
    color: var(--sf-grey-500);
    display: flex;
    align-items: center;
    gap: 0;
}

.sf-crumb a {
    color: var(--sf-teal-dark);
    text-decoration: none;
}

.sf-crumb a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sf-crumb__sep {
    margin: 0 8px;
    color: var(--sf-grey-300);
}

.sf-crumb__current {
    color: var(--sf-grey-700);
    font-weight: 500;
}

/* ---- Main content ---- */
.sf-main {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 80px;
    flex: 1;
}

/* ---- Section titles ---- */
.sf-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px 0;
}

.sf-section-label__text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sf-grey-500);
    white-space: nowrap;
}

.sf-section-label__line {
    flex: 1;
    height: 1px;
    background: var(--sf-grey-200);
}

/* ---- Year group ---- */
.sf-year {
    margin-bottom: 40px;
}

.sf-year__label {
    font-family: var(--sf-font-script);
    font-size: 1.8rem;
    color: var(--sf-teal);
    margin: 0 0 16px 0;
}

/* ---- Event cards (index) ---- */
.sf-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.sf-event-card {
    background: var(--sf-white);
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--sf-speed) var(--sf-ease),
                transform var(--sf-speed) var(--sf-ease);
}

.sf-event-card:hover {
    box-shadow: var(--sf-shadow-hover);
    transform: translateY(-3px);
    color: inherit;
}

.sf-event-card__accent {
    height: 4px;
    background: linear-gradient(90deg, var(--sf-teal), var(--sf-teal-dark));
}

.sf-event-card__body {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sf-event-card__date {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sf-teal);
    margin-bottom: 6px;
}

.sf-event-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sf-dark);
    line-height: 1.35;
    margin: 0 0 10px 0;
    flex: 1;
}

.sf-event-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sf-event-card__location {
    font-size: 0.78rem;
    color: var(--sf-grey-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sf-event-card__status {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.sf-event-card__status--published {
    color: var(--sf-teal-dark);
    background: var(--sf-teal-light);
}

.sf-event-card__status--finished {
    color: var(--sf-grey-700);
    background: var(--sf-grey-100);
}

/* ---- Event detail header ---- */
.sf-event-hero {
    background: var(--sf-white);
    border-bottom: 1px solid var(--sf-grey-200);
    padding: 40px 24px;
}

.sf-event-hero__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.sf-event-hero__script {
    font-family: var(--sf-font-script);
    font-size: 1rem;
    color: var(--sf-teal);
    margin: 0 0 4px 0;
}

.sf-event-hero__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sf-dark);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.sf-event-hero__meta {
    font-size: 0.9rem;
    color: var(--sf-grey-500);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sf-event-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sf-event-hero__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sf-grey-300);
}

/* ---- Division grid ---- */
.sf-div-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.sf-div-card {
    background: var(--sf-white);
    border: 1px solid var(--sf-grey-200);
    border-radius: var(--sf-radius);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all var(--sf-speed) var(--sf-ease);
    position: relative;
    overflow: hidden;
}

.sf-div-card::after {
    content: '\2192';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sf-grey-300);
    font-size: 1.1rem;
    transition: all var(--sf-speed) var(--sf-ease);
}

.sf-div-card:hover {
    border-color: var(--sf-teal);
    box-shadow: var(--sf-shadow-sm);
    color: inherit;
}

.sf-div-card:hover::after {
    color: var(--sf-teal);
    right: 12px;
}

.sf-div-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sf-dark);
    margin: 0;
    padding-right: 30px;
}

.sf-div-card__status {
    font-size: 0.75rem;
    color: var(--sf-grey-500);
    margin-top: 4px;
}

/* ---- Results section ---- */
.sf-round {
    margin-bottom: 36px;
}

.sf-round__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sf-dark);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sf-round__title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--sf-teal), transparent);
}

.sf-heat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sf-teal-dark);
    background: var(--sf-teal-light);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    margin: 20px 0 8px 0;
}

.sf-results-wrap {
    background: var(--sf-white);
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.sf-results {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.sf-results thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sf-grey-500);
    background: var(--sf-off-white);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 2px solid var(--sf-grey-200);
}

.sf-results thead th:last-child {
    text-align: right;
}

.sf-results tbody td {
    padding: 10px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--sf-grey-100);
    color: var(--sf-ink);
}

.sf-results tbody td:last-child {
    text-align: right;
    font-weight: 500;
}

.sf-results tbody tr:last-child td {
    border-bottom: none;
}

.sf-results tbody tr:hover td {
    background: var(--sf-teal-glow);
}

/* Place column */
.sf-results .col-place {
    width: 56px;
    font-weight: 700;
    font-size: 0.9rem;
}

.sf-results .col-team {
    color: var(--sf-grey-500);
    font-size: 0.82rem;
}

.sf-results .col-total {
    width: 72px;
    font-weight: 600;
    color: var(--sf-grey-700);
}

/* Podium rows */
.sf-results tr[data-place="1"] .col-place {
    color: var(--sf-gold);
}

.sf-results tr[data-place="1"] {
    background: linear-gradient(90deg, rgba(212,160,23,0.06) 0%, transparent 50%);
}

.sf-results tr[data-place="2"] .col-place {
    color: var(--sf-silver);
}

.sf-results tr[data-place="3"] .col-place {
    color: var(--sf-bronze);
}

/* ---- Empty state ---- */
.sf-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--sf-grey-500);
    font-size: 0.9rem;
}

.sf-empty__script {
    font-family: var(--sf-font-script);
    font-size: 1.1rem;
    color: var(--sf-teal);
    margin-bottom: 4px;
}

/* ---- Back link ---- */
.sf-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sf-teal-dark);
    text-decoration: none;
    margin-bottom: 24px;
    transition: gap var(--sf-speed) var(--sf-ease);
}

.sf-back:hover {
    gap: 10px;
    color: var(--sf-teal);
}

.sf-back::before {
    content: '\2190';
    font-size: 1rem;
}

/* ---- Footer ---- */
.sf-footer {
    background: var(--sf-dark);
    color: rgba(255,255,255,0.5);
    padding: 32px 24px;
    text-align: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.sf-footer__script {
    font-family: var(--sf-font-script);
    font-size: 1.2rem;
    color: var(--sf-teal);
    margin-bottom: 8px;
}

.sf-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.sf-footer a:hover {
    color: var(--sf-teal);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .sf-hero { padding: 40px 20px; }
    .sf-hero__title { font-size: 1.6rem; }
    .sf-event-hero__title { font-size: 1.4rem; }
    .sf-events-grid { grid-template-columns: 1fr; }
    .sf-div-grid { grid-template-columns: 1fr; }
    .sf-results thead th,
    .sf-results tbody td { padding: 8px 10px; font-size: 0.82rem; }
    .sf-masthead__label { display: none; }
}

/* ---- Search ---- */
.sf-search { width: 100%; max-width: 400px; padding: .65rem 1rem; margin-bottom: 1.5rem; border: 1px solid #d0d7de; border-radius: .5rem; font-size: .95rem; outline: none; transition: border-color .2s; }
.sf-search:focus { border-color: var(--sf-teal, #0ea5a0); box-shadow: 0 0 0 3px rgba(14,165,160,.15); }

/* ---- Table (Ultimate Lifeguard) ---- */
.sf-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; background: #fff; border-radius: .5rem; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.sf-table th, .sf-table td { padding: .6rem 1rem; text-align: left; border-bottom: 1px solid #e8edf2; }
.sf-table thead th { background: var(--sf-teal, #0ea5a0); color: #fff; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.sf-table tbody tr:hover { background: #f0fafa; }

/* ---- Print ---- */
@media print {
    .sf-masthead, .sf-footer, .sf-crumb, .sf-back, .sf-hero { display: none; }
    .surf-area { background: white; }
    .sf-results-wrap { box-shadow: none; border: 1px solid #ddd; }
    .sf-results thead th { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
