/*
Theme Name: Mariner Recruit
Description: A bold, modern theme for maritime recruitment and crewing agencies. Includes a Vacancies section (with filters), a front-end "Post a vacancy" form for employers, CV-upload applications for seafarers, and About, Services and Contact pages. Activating it creates the pages, menus, job categories and a few sample vacancies automatically.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mariner-recruit
*/

:root {
  --navy: #04122a;
  --deep: #0a2347;
  --ocean: #0e5a8a;
  --aqua: #22e0d0;
  --signal: #ff7a3d;
  --foam: #eaf6f8;
  --sand: #f4f1ea;
  --white: #ffffff;
  --muted: #5a6a82;
  --line: rgba(4, 18, 42, .14);
  --radius: 20px;
  --max: 1180px;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 1.65; color: var(--navy); background: var(--sand); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ocean); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--signal); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1.1em; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 999; background: var(--signal); color: var(--navy); padding: 10px 16px; border-radius: 8px; }

/* Buttons */
.btn { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .98rem; padding: 14px 26px; border-radius: 999px; border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease; line-height: 1.2; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--signal); color: var(--navy); box-shadow: 0 10px 30px rgba(255,122,61,.35); }
.btn-primary:hover { background: var(--white); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }
.btn-ghost:hover { border-color: var(--aqua); color: var(--aqua); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--ocean); color: var(--white); }
.btn-sm { padding: 10px 20px; font-size: .9rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(4,18,42,.9); backdrop-filter: blur(12px); color: var(--white); transition: box-shadow .2s ease; }
.site-header.scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 18px; }
.site-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--white); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.site-brand svg { width: 30px; height: 30px; flex: none; }
.site-brand img { max-height: 46px; width: auto; }
.header-right { display: flex; align-items: center; gap: 14px; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.main-nav a { color: rgba(255,255,255,.86); text-decoration: none; font-weight: 500; font-size: .96rem; padding: 10px 15px; border-radius: 999px; display: block; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--navy); background: var(--aqua); }
.nav-toggle { display: none; background: none; border: 2px solid rgba(255,255,255,.4); color: var(--white); border-radius: 10px; padding: 8px 14px; font-family: var(--font-head); font-weight: 600; cursor: pointer; }

/* Hero */
.hero { background: radial-gradient(900px 520px at 88% 8%, rgba(34,224,208,.28), transparent 60%), radial-gradient(800px 600px at 5% 95%, rgba(14,90,138,.7), transparent 60%), linear-gradient(160deg, var(--navy), var(--deep)); color: var(--white); position: relative; overflow: hidden; padding: clamp(70px, 10vw, 130px) 0 clamp(150px, 16vw, 210px); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(34,224,208,.12); color: var(--aqua); border: 1px solid rgba(34,224,208,.4); font-weight: 600; font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; padding: 7px 14px; border-radius: 999px; margin-bottom: 24px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 4px rgba(34,224,208,.25); }
.hero h1 { max-width: 13ch; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--aqua), #8cf5ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(1.08rem, 2vw, 1.3rem); max-width: 54ch; color: rgba(255,255,255,.78); margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-visual { position: relative; aspect-ratio: 1; max-width: 460px; margin-inline: auto; width: 100%; }
.hero-visual svg.compass { width: 100%; height: 100%; }
.compass .ring { transform-origin: 200px 200px; animation: spin 60s linear infinite; }
.compass .ring2 { transform-origin: 200px 200px; animation: spin 90s linear infinite reverse; }
.compass .needle { transform-origin: 200px 200px; animation: sway 6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sway { 0%,100% { transform: rotate(38deg); } 50% { transform: rotate(52deg); } }
.float-card { position: absolute; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); border-radius: 16px; padding: 14px 18px; box-shadow: 0 20px 40px rgba(0,0,0,.3); animation: bob 5s ease-in-out infinite; }
.float-card strong { display: block; font-family: var(--font-head); font-size: 1.7rem; line-height: 1; color: var(--aqua); }
.float-card span { font-size: .85rem; color: rgba(255,255,255,.8); }
.float-card.a { top: 6%; left: -4%; }
.float-card.b { bottom: 10%; right: -2%; animation-delay: -2.5s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; height: 140px; z-index: 1; pointer-events: none; }
.waves div { position: absolute; inset: 0; background-repeat: repeat-x; background-size: 1200px 100%; }
.waves .w1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 60 C200 100 400 100 600 60 S1000 20 1200 60 V120 H0Z' fill='%2322e0d0' fill-opacity='.35'/%3E%3C/svg%3E"); animation: drift 22s linear infinite; }
.waves .w2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 70 C200 30 400 30 600 70 S1000 110 1200 70 V120 H0Z' fill='%230e5a8a' fill-opacity='.6'/%3E%3C/svg%3E"); animation: drift 34s linear infinite reverse; }
.waves .w3 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 80 C200 110 400 110 600 80 S1000 50 1200 80 V120 H0Z' fill='%23f4f1ea'/%3E%3C/svg%3E"); animation: drift 46s linear infinite; }
@keyframes drift { to { background-position-x: 1200px; } }

/* Strip */
.strip { background: var(--signal); color: var(--navy); overflow: hidden; }
.strip-inner { display: flex; gap: 48px; padding: 15px 0; white-space: nowrap; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; animation: slide 30s linear infinite; width: max-content; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-dark { background: linear-gradient(160deg, var(--navy), var(--deep)); color: var(--white); }
.section-white { background: var(--white); }
.section-head { max-width: 740px; margin-bottom: 48px; }
.section-head.row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.kicker { font-family: var(--font-head); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ocean); margin-bottom: 14px; display: block; }
.section-dark .kicker { color: var(--aqua); }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.section-dark .section-head p { color: rgba(255,255,255,.7); }

/* Cards / services */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--white); border-radius: var(--radius); padding: 32px; border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--aqua), var(--ocean)); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(4,18,42,.14); }
.card:hover::after { transform: scaleX(1); }
.card .icon { width: 54px; height: 54px; border-radius: 16px; background: var(--navy); color: var(--aqua); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; margin-bottom: 20px; }
.card p { color: var(--muted); margin: 0; }

/* Two-path CTA */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.path { border-radius: 28px; padding: clamp(32px, 5vw, 56px); position: relative; overflow: hidden; }
.path h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.path.seafarer { background: linear-gradient(150deg, var(--ocean), var(--deep)); color: var(--white); }
.path.employer { background: var(--aqua); color: var(--navy); }
.path p { max-width: 42ch; opacity: .9; }
.path .btn { margin-top: 8px; }
.path.seafarer .btn-primary { }
.path.employer .btn-dark { }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat strong { display: block; font-family: var(--font-head); font-size: clamp(2.5rem, 5vw, 3.8rem); background: linear-gradient(90deg, var(--aqua), #8cf5ff); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin-bottom: 8px; }
.stat span { color: rgba(255,255,255,.72); }

/* Process */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { border-top: 3px solid var(--navy); padding-top: 20px; counter-increment: step; }
.step::before { content: "0" counter(step); font-family: var(--font-head); font-weight: 700; font-size: 2.3rem; color: var(--signal); display: block; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* Split + checklist */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.panel { background: linear-gradient(150deg, var(--deep), var(--navy)); color: var(--white); border-radius: 28px; padding: clamp(30px, 5vw, 52px); }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { padding: 14px 0 14px 40px; position: relative; border-bottom: 1px solid rgba(255,255,255,.15); font-weight: 500; }
.panel li:last-child { border: 0; }
.panel li::before { content: "✓"; position: absolute; left: 0; top: 14px; width: 26px; height: 26px; background: var(--aqua); color: var(--navy); border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

/* CTA band */
.cta { background: linear-gradient(120deg, var(--signal), #ffa24d); text-align: center; padding: clamp(60px, 8vw, 110px) 0; }
.cta h2 { max-width: 18ch; margin-inline: auto; }
.cta p { font-size: 1.15rem; max-width: 50ch; margin: 0 auto 30px; }

/* Page hero & content */
.page-hero { background: radial-gradient(700px 300px at 90% 0, rgba(34,224,208,.25), transparent 60%), linear-gradient(160deg, var(--navy), var(--deep)); color: var(--white); padding: clamp(56px, 8vw, 100px) 0; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); margin: 0; max-width: 22ch; }
.page-hero p { color: rgba(255,255,255,.75); max-width: 60ch; margin: 16px 0 0; font-size: 1.1rem; }
.page-hero .actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.page-hero .meta { color: rgba(255,255,255,.7); margin-top: 16px; }
.entry { padding: clamp(48px, 7vw, 90px) 0; }
.entry-content { max-width: 780px; }
.entry-content h2 { font-size: 1.9rem; margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content img { border-radius: var(--radius); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(34,224,208,.15); color: var(--aqua); border: 1px solid rgba(34,224,208,.35); }
.vcard .chip, .card-chips .chip { background: var(--foam); color: var(--ocean); border-color: transparent; }
.chip.sample { background: #fff1e8; color: #b2480f; }

/* Vacancies */
.filter-bar { background: var(--white); border-radius: var(--radius); padding: 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; margin-bottom: 36px; box-shadow: 0 14px 40px rgba(4,18,42,.08); position: relative; margin-top: -48px; z-index: 3; }
.filter-bar input, .filter-bar select { width: 100%; padding: 13px 14px; font: inherit; border: 2px solid var(--line); border-radius: 12px; background: var(--white); color: var(--navy); }
.filter-bar input:focus, .filter-bar select:focus { outline: 3px solid var(--aqua); outline-offset: 1px; border-color: transparent; }
.vac-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.vcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; position: relative; }
.vcard:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(4,18,42,.14); }
.vcard .dept { font-family: var(--font-head); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); margin-bottom: 10px; }
.vcard h2, .vcard h3 { font-size: 1.3rem; margin-bottom: 14px; }
.vcard h2 a, .vcard h3 a { color: var(--navy); text-decoration: none; }
.vcard h2 a:hover, .vcard h3 a:hover { color: var(--ocean); }
.vcard dl { margin: 0 0 18px; display: grid; gap: 6px; font-size: .95rem; }
.vcard dl div { display: flex; gap: 8px; }
.vcard dt { color: var(--muted); min-width: 74px; }
.vcard dd { margin: 0; font-weight: 600; }
.vcard .actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vcard .card-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { background: var(--white); border-radius: var(--radius); padding: 40px; text-align: center; }

.vac-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.side-card { background: var(--white); border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); margin-bottom: 24px; }
.side-card dl { margin: 0; display: grid; gap: 12px; }
.side-card dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.side-card dd { margin: 0; font-weight: 600; }
.apply-card { background: linear-gradient(160deg, var(--deep), var(--navy)); color: var(--white); border-radius: var(--radius); padding: 30px; scroll-margin-top: 100px; }
.apply-card h3 { color: var(--aqua); }
.sticky { position: sticky; top: 100px; }

/* Forms */
.mr-form label { display: block; font-weight: 600; margin-bottom: 6px; font-family: var(--font-head); font-size: .92rem; }
.mr-form .field { margin-bottom: 18px; }
.mr-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mr-form input[type=text], .mr-form input[type=email], .mr-form input[type=tel], .mr-form input[type=date], .mr-form select, .mr-form textarea, .mr-form input[type=file] {
  width: 100%; padding: 13px 15px; font: inherit; border: 2px solid var(--line); border-radius: 12px; background: var(--white); color: var(--navy);
}
.mr-form input:focus, .mr-form select:focus, .mr-form textarea:focus { outline: 3px solid var(--aqua); outline-offset: 1px; border-color: transparent; }
.mr-form textarea { min-height: 140px; resize: vertical; }
.mr-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-family: var(--font-body); font-size: .92rem; }
.mr-form .check input { margin-top: 5px; }
.mr-form small { color: var(--muted); display: block; margin-top: 4px; }
.apply-card .mr-form label { color: var(--white); }
.apply-card .mr-form small { color: rgba(255,255,255,.65); }
.apply-card .mr-form .check { color: rgba(255,255,255,.85); }
.mr-hp { position: absolute; left: -9999px; }
.mr-notice { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-weight: 600; }
.mr-notice.ok { background: var(--aqua); color: var(--navy); }
.mr-notice.err { background: #ffd9cf; color: #7a1d00; }
.form-wrap { background: var(--white); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); max-width: 860px; }
.contact-wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 6vw, 72px); align-items: start; }
.contact-info { background: linear-gradient(160deg, var(--deep), var(--navy)); color: var(--white); border-radius: var(--radius); padding: 36px; }
.contact-info a { color: var(--aqua); }
.contact-info h3 { color: var(--aqua); }

/* Posts */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--ocean), var(--navy)); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 1.35rem; }
.post-card h2 a { color: var(--navy); text-decoration: none; }
.post-card .date { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.post-card p { color: var(--muted); }
.post-card .more { margin-top: auto; font-weight: 600; font-family: var(--font-head); }
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 10px 18px; border-radius: 999px; text-decoration: none; color: var(--navy); font-weight: 600; background: var(--white); border: 1px solid var(--line); }
.pagination .current { background: var(--navy); color: var(--white); }

.not-found { text-align: center; padding: 120px 0; }
.not-found .big { font-family: var(--font-head); font-size: clamp(6rem, 18vw, 12rem); font-weight: 700; color: var(--ocean); line-height: 1; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding: 72px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.14); }
.site-footer h4 { color: var(--white); font-size: 1.05rem; }
.site-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.site-footer a:hover { color: var(--aqua); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { padding-top: 24px; font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-inline: auto; display: block; }
.wp-caption-text, figcaption { font-size: .9rem; color: var(--muted); }

@media (max-width: 960px) {
  .hero-grid, .split, .contact-wrap, .vac-layout, .paths, .footer-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 340px; }
  .grid-3, .vac-list, .post-grid { grid-template-columns: 1fr 1fr; }
  .stats, .steps { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .sticky { position: static; }
}
@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .header-right .btn { display: none; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); display: none; padding: 12px 20px 24px; border-top: 1px solid rgba(255,255,255,.12); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .grid-3, .vac-list, .post-grid, .stats, .steps, .filter-bar, .mr-form .two { grid-template-columns: 1fr; }
  .float-card.a { left: 0; }
  .float-card.b { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .strip-inner, .waves div, .compass .ring, .compass .ring2, .compass .needle, .float-card { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
