/* =====================================================
   ASP SOUTH AMERICA - NEW DESIGN (site-wide override)
   Load AFTER the theme's style.css, before </head>:
   <link rel="stylesheet" href="/wp-content/themes/aspsouthamerica/asp-new-design.css">
===================================================== */

:root {
    --navy: #071b36;
    --navy-light: #102c50;
    --navy-dark: #041329;
    --blue: #087fbd;
    --cyan: #24c4df;
    --white: #ffffff;
    --light: #f3f6fa;
    --text: #263447;
    --muted: #718096;
    --border: #e5eaf0;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(7,27,54,.08);
    --shadow-hover: 0 15px 35px rgba(7,27,54,.13);
    --max: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: Arial, Helvetica, sans-serif !important;
    background: var(--light) !important;
    background-image: none !important;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { color: var(--navy); line-height: 1.25; font-family: Arial, Helvetica, sans-serif; }

/* ---------- Old decorative wrappers ---------- */
#wrap-top, #wrap-bottom, #navfoot { display: none !important; }

/* ---------- Top bar ---------- */
#topstuff {
    background: var(--navy-dark) !important;
    margin: 0 !important;
    min-height: 34px;
    width: 100% !important;
}
#topstuff::before {
    content: "ASP SOUTH AMERICA \00B7  OFFICIAL SURFING PORTAL";
    display: block;
    width: min(var(--max), 94%);
    margin: auto;
    padding: 9px 0;
    color: #b9c8dc;
    font-size: 12px;
}
#search { display: none; }

/* ---------- Navigation bar ---------- */
#nav {
    background: var(--navy) !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(3%, calc((100% - var(--max)) / 2)) !important;
    margin: 0 !important;
    position: relative;
    z-index: 999;
}
#nav > div:first-child { float: none !important; }
#social { float: none !important; display: flex; gap: 9px; }
#social .socialicon { float: none !important; }

/* ---------- Page wrapper ---------- */
#wrap, #page {
    width: min(var(--max), 94%) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    float: none !important;
}
#page { padding: 40px 0 60px !important; }

#contentleft, .maincontent {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}
#content {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

/* ---------- Breadcrumbs + page title ---------- */
#breadcrumbs {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 14px !important;
    padding: 0 !important;
}
#breadcrumbs a { color: var(--blue); }
#breadcrumbs strong { color: var(--navy); }

h1.archive-title,
.page-title,
#content > h1:first-of-type {
    background: linear-gradient(90deg, rgba(3,18,38,.96), rgba(16,44,80,.9)), var(--navy);
    color: #fff !important;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
    letter-spacing: -1px;
    padding: 38px 34px;
    border-radius: var(--radius);
    margin: 0 0 28px !important;
    border: 0 !important;
}

/* ---------- Archive grid (list of posts) ---------- */
#content:has(.viewpost) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
#content:has(.viewpost) > #breadcrumbs,
#content:has(.viewpost) > h1,
#content:has(.viewpost) > .wp-pagenavi,
#content:has(.viewpost) > .navigation {
    grid-column: 1 / -1;
}

/* ---------- Post cards (archive) ---------- */
.post:has(.viewpost) {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: .3s;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: auto !important;
    float: none !important;
}
.post:has(.viewpost):hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.post:has(.viewpost) .entry {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 !important;
    margin: 0 !important;
}
.post:has(.viewpost) .entry > *:not(.feature-image) { margin-left: 20px; margin-right: 20px; }

.feature-image {
    order: 0;
    float: none !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    height: 210px;
    overflow: hidden;
    background: #dce6ee;
    position: relative;
}
.feature-image a { display: block; height: 100%; }
.feature-image img,
img.post_thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    transition: .5s;
}
.post:hover .feature-image img { transform: scale(1.06); }

.post:has(.viewpost) .entry > .meta {
    order: 1;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: 8px;
}
.meta .comments a { color: var(--muted); }

.post-title, h2.post-title, h1.post-title {
    font-size: 17px;
    line-height: 1.4;
    color: var(--navy);
    margin: 0 0 10px;
    font-weight: 700;
    border: 0;
}
.post:has(.viewpost) .entry > .post-title { order: 2; }
.post-title a { color: var(--navy); }
.post-title a:hover { color: var(--blue); }

.post:has(.viewpost) .entry > p {
    order: 3;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.viewpost {
    padding: 0 20px 20px !important;
    margin: 0 !important;
    float: none !important;
    text-align: left !important;
}
.viewpost a {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    background: none !important;
    padding: 0 !important;
    border: 0 !important;
}
.viewpost a::after { content: " \2192"; }
.post > div[style*="clear"] { display: none; }

/* ---------- Pagination ---------- */
.wp-pagenavi, .navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 0 !important;
    padding: 0 !important;
}
.wp-pagenavi a, .wp-pagenavi span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px !important;
    display: grid;
    place-items: center;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--navy) !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: var(--shadow);
    border: 0 !important;
    margin: 0 !important;
    transition: .2s;
}
.wp-pagenavi a:hover { background: var(--blue) !important; color: #fff !important; }
.wp-pagenavi span.current { background: var(--navy) !important; color: #fff !important; }
.wp-pagenavi span.pages { box-shadow: none; background: transparent !important; color: var(--muted) !important; font-weight: 400; }
.wp-pagenavi span.extend { box-shadow: none; background: transparent !important; }

/* ---------- Single post / normal pages ---------- */
.post:not(:has(.viewpost)),
.page.type-page {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px !important;
    margin: 0 0 24px !important;
    border: 0 !important;
}
.post:not(:has(.viewpost)) .post-title,
.post:not(:has(.viewpost)) h1 {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 900;
    letter-spacing: -.5px;
    margin-bottom: 12px;
}
.post:not(:has(.viewpost)) .entry { line-height: 1.8; font-size: 15px; }
.post:not(:has(.viewpost)) .entry img { border-radius: 9px; }
.entry h2, .entry h3 { margin: 26px 0 12px; }
.entry blockquote {
    border-left: 4px solid var(--cyan);
    background: var(--light);
    margin: 20px 0;
    padding: 14px 20px;
    border-radius: 0 10px 10px 0;
}

/* ---------- Tables (rankings, calendar, surfers) ---------- */
.dataTables_wrapper,
.wp-table-reloaded-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin: 0 0 24px;
    overflow-x: auto;
}
table.wp-table-reloaded,
table.dataTable,
table.memberpro,
#content table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
#content table th,
table.dataTable thead th,
.wp-table-reloaded .row-1 th,
.wp-table-reloaded .row-1 td {
    background: var(--navy) !important;
    color: #fff !important;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .5px;
    padding: 12px 10px;
    border: 0 !important;
}
.wp-table-reloaded .row-1 { background: var(--navy) !important; }
#content table td {
    padding: 10px;
    border-bottom: 1px solid var(--border) !important;
    border-left: 0;
    border-right: 0;
}
#content table tr:nth-child(even) td,
table.dataTable tr.even td { background: #f8fafc !important; }
#content table tbody tr:hover td { background: #eaf6fc !important; }

.dataTables_filter input,
.dataTables_length select,
input[type="text"], input[type="email"], input[type="search"], input[type="password"],
textarea, select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--cyan);
    outline-offset: 1px;
}
.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 0 !important;
    background: var(--light) !important;
    color: var(--navy) !important;
    padding: 6px 12px !important;
    margin: 0 2px;
}
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_active { background: var(--navy) !important; color: #fff !important; }

/* ---------- Buttons ---------- */
button, input[type="submit"], .button, a.button {
    display: inline-block;
    background: var(--cyan);
    color: var(--navy);
    border: 0;
    border-radius: 8px;
    padding: 12px 22px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: .25s;
}
button:hover, input[type="submit"]:hover, .button:hover { background: var(--navy); color: #fff; }

/* ---------- Comments ---------- */
#comments, #respond { margin-top: 30px; }
.commentlist { list-style: none; margin: 0; padding: 0; }
.commentlist li {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 14px;
}

/* ---------- Sidebar widgets (if a page has one) ---------- */
#sidebar, #contentright, .sidebar {
    float: none !important;
    width: 100% !important;
}
#sidebar .widget, #contentright .widget, .sidebar .widget {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
    padding: 0 0 12px;
}
.widget h2, .widget h3, .widgettitle, .widget-title {
    background: var(--navy);
    color: #fff;
    padding: 16px 20px;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.widget ul { list-style: none; margin: 0; padding: 0 18px; }
.widget li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.widget li:last-child { border-bottom: 0; }

/* ---------- Footer (old inline-styled #000036 block) ---------- */
body > div[style*="000036"] {
    background: var(--navy-dark) !important;
    width: 100% !important;
    margin: 0 !important;
    color: #b9c8dc;
}
body > div[style*="000036"] > div {
    width: min(var(--max), 94%) !important;
    padding: 55px 0 25px !important;
    margin: auto !important;
}
body > div[style*="000036"] table { width: 100% !important; }
body > div[style*="000036"] td[bgcolor] { background: rgba(255,255,255,.1) !important; }

.footheader {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700;
    margin-bottom: 8px;
}
.footlink, a.footlink {
    display: inline-block;
    color: #9aacc4 !important;
    font-size: 12px !important;
    padding: 4px 0;
    transition: .2s;
}
a.footlink:hover { color: var(--cyan) !important; }
.footnotice, a.footnotice { color: #9aacc4 !important; font-size: 12px !important; }
body > div[style*="000036"] td { color: #9aacc4; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
    #content:has(.viewpost) { grid-template-columns: 1fr; }
    #nav { flex-wrap: wrap; overflow-x: auto; }
    body > div[style*="000036"] table { display: block; overflow-x: auto; }
    .post:not(:has(.viewpost)), .page.type-page { padding: 22px !important; }
}

@media (max-width: 550px) {
    #topstuff::before { text-align: center; font-size: 11px; }
    h1.archive-title, .page-title, #content > h1:first-of-type { padding: 26px 22px; }
    .feature-image { height: 220px; }
}

/* ---------- Accessibility ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}