/* =========================================================
   Scottish Pigs website - styles
   To change the site colours, edit the values in :root below.
   ========================================================= */
:root {
  --brand: #17539c;        /* Scottish Pigs logo blue */
  --brand-dark: #0f3a6e;
  --brand-light: #e8f0fa;
  --accent: #c8553d;       /* warm accent for alerts / buttons */
  --text: #1b2230;
  --muted: #546072;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --line: #d6dfea;
  --todo-bg: #fff6cc;
  --todo-line: #e0c040;
  --radius: 8px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; color: var(--brand-dark); }
h1 { font-size: 2.2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .75rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 99; }

/* ---------- Header & menu ---------- */
.site-header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.logo:hover { color: #fff; }
.logo img { height: 34px; width: auto; }
.menu-toggle { display: none; background: none; border: 2px solid #fff; color: #fff; border-radius: 6px; padding: 6px 12px; font-size: 1rem; cursor: pointer; }
nav.main ul { list-style: none; margin: 0; padding: 0; }
nav.main > ul { display: flex; gap: 2px; }
nav.main li { position: relative; }
nav.main a { display: block; color: #fff; text-decoration: none; padding: 10px 11px; border-radius: 6px; font-size: .95rem; white-space: nowrap; }
nav.main a:hover, nav.main a.current { background: var(--brand-dark); }
nav.main li ul { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 230px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; }
nav.main li ul a { color: var(--text); }
nav.main li ul a:hover, nav.main li ul a.current { background: var(--brand-light); color: var(--brand-dark); }
nav.main li:hover > ul, nav.main li:focus-within > ul { display: block; }
nav.main .has-sub > a::after { content: " ▾"; font-size: .8em; }
.login-btn { background: #fff; color: var(--brand) !important; font-weight: 600; }
.login-btn:hover { background: var(--brand-light) !important; }

@media (max-width: 1100px) {
  .menu-toggle { display: block; }
  nav.main { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--brand); padding: 8px 16px 16px; max-height: calc(100vh - 68px); overflow-y: auto; }
  nav.main.open { display: block; }
  nav.main > ul { flex-direction: column; }
  nav.main li ul { display: block; position: static; background: none; box-shadow: none; padding: 0 0 0 14px; }
  nav.main li ul a { color: #fff; }
  nav.main li ul a:hover, nav.main li ul a.current { background: var(--brand-dark); color: #fff; }
  nav.main .has-sub > a::after { content: ""; }
}

/* ---------- Page banners ---------- */
.hero { background: linear-gradient(90deg, rgba(15,58,110,.92) 0%, rgba(15,58,110,.75) 45%, rgba(15,58,110,.15) 100%), url("../images/photos/hero-piglets-outdoors.jpg") center 35% / cover no-repeat var(--brand-dark); color: #fff; padding: 80px 0 72px; }
.hero h1 { color: #fff; font-size: 2.6rem; max-width: 620px; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.hero p { font-size: 1.2rem; max-width: 560px; opacity: .95; }
@media (max-width: 700px) { .hero { background: linear-gradient(rgba(15,58,110,.82), rgba(15,58,110,.82)), url("../images/photos/hero-piglets-outdoors.jpg") center / cover no-repeat var(--brand-dark); } }
.photo-right { float: right; width: 42%; margin: 4px 0 16px 24px; }
.photo-right img, .photo-full img { border-radius: var(--radius); }
.photo-right figcaption, .photo-full figcaption { font-size: .85rem; }
.clear { clear: both; }
@media (max-width: 700px) { .photo-right { float: none; width: 100%; margin: 16px 0; } }
/* Footer: four columns (logo, contact, pages, useful links) with equal gaps between them */
.footer-logo { width: 120px; }
.site-footer .footer-grid { grid-template-columns: auto 1fr; gap: 28px 24px; }
.site-footer .footer-grid > div:nth-child(n+3) { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .site-footer .footer-grid { grid-template-columns: repeat(4, auto); justify-content: space-between; }
  .site-footer .footer-grid > div:nth-child(n+3) { grid-column: auto; }
}
@media (max-width: 420px) { .footer-logo { width: 90px; } .site-footer .footer-grid { column-gap: 16px; } }
.page-hero { background: var(--brand-light); padding: 36px 0 28px; border-bottom: 1px solid var(--line); }
.crumb { margin: 0 0 6px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 760px; margin: 0; }

/* ---------- Content ---------- */
.content { padding-top: 12px; padding-bottom: 56px; max-width: 860px; }
.content.wide { max-width: var(--wrap); }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 12px 22px; border-radius: 6px; font-weight: 600; }
.btn:hover { color: #fff; filter: brightness(.92); }
.btn.secondary { background: #fff; color: var(--brand-dark); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 20px 0; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s; }
a.card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.08); color: var(--text); }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

.alert { border-left: 6px solid var(--accent); background: #fbeeea; padding: 18px 20px; border-radius: var(--radius); margin: 24px 0; }
.alert h2, .alert h3 { margin-top: 0; color: #8a2e1c; }
.info { border-left: 6px solid var(--brand); background: var(--brand-light); padding: 18px 20px; border-radius: var(--radius); margin: 24px 0; }
.info h3 { margin-top: 0; }

.section-alt { background: var(--bg-alt); padding: 8px 0 40px; }

.downloads { list-style: none; padding: 0; margin: 12px 0; }
.downloads li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.downloads .type { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--bg-alt); padding: 2px 8px; border-radius: 4px; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.person strong { display: block; }
.person span { color: var(--muted); font-size: .95rem; }

.news-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.news-item .date { color: var(--muted); font-size: .9rem; }
.news-item h3 { margin: 4px 0 6px; }

figure { margin: 24px 0; }
figure img { border-radius: var(--radius); border: 1px solid var(--line); }
figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--brand-light); color: var(--brand-dark); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; }
.stat strong { display: block; font-size: 1.6rem; color: var(--brand-dark); line-height: 1.2; }
.stat span { font-size: .9rem; color: var(--muted); }
.formula { background: var(--bg-alt); border-radius: var(--radius); padding: 14px 16px; font-family: Consolas, monospace; font-size: .9rem; overflow-x: auto; }

.timeline { list-style: none; padding: 0; margin: 20px 0; border-left: 3px solid var(--brand); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .when { font-weight: 700; color: var(--brand); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.timeline h3 { margin: 2px 0 6px; }
.timeline li.now::before { background: var(--accent); border-color: var(--accent); }
.cat { display: inline-block; min-width: 28px; text-align: center; font-weight: 700; border-radius: 4px; padding: 2px 6px; color: #fff; }
.cat1 { background: #2e7d4f; } .cat2 { background: #6aa84f; } .cat3 { background: #d98a1f; } .cat4 { background: #b5402a; } .cat5 { background: #888; }

.page-logo { width: 340px; max-width: 80%; margin: 4px 0 14px; }
.split { display: flex; gap: 20px; align-items: center; }
.split img { width: 120px; flex-shrink: 0; }
.icon-heading { display: flex; align-items: center; gap: 12px; }
.icon-heading img { width: 40px; height: 40px; flex-shrink: 0; }
.routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 20px 0; }
.route { text-align: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; background: #fff; }
.route img { width: 90px; height: 90px; object-fit: contain; margin: 0 auto 8px; }
.route strong { display: block; color: var(--brand-dark); font-size: .95rem; }
.route span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.4; margin-top: 4px; }
@media (max-width: 600px) { .split { flex-direction: column; align-items: flex-start; } .split img { width: 90px; } }

/* PRRS Top 10 risk areas */
.top10 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 20px 0; }
.risk { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.risk img { width: 72px; height: 72px; flex-shrink: 0; background: #e8462a; border-radius: 50%; }
.risk strong { display: block; color: var(--brand-dark); }
.risk p { margin: 4px 0 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.risk-no { display: inline-block; min-width: 24px; height: 24px; border-radius: 50%; background: #e8462a; color: #fff; font-size: .8rem; text-align: center; line-height: 24px; margin-right: 8px; }
/* PCES signs and materials */
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 20px 0; }
.material { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fff; }
.material img { width: 100%; height: 170px; object-fit: contain; background: var(--bg-alt); border-radius: 6px; margin-bottom: 10px; }
.material strong { display: block; color: var(--brand-dark); font-size: .95rem; }
.material span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.material .size { font-weight: 600; margin: 2px 0 4px; }
@media (max-width: 400px) { .top10 { grid-template-columns: 1fr; } }

.material-strip { display: flex; gap: 10px; margin: 16px 0; overflow: hidden; border-radius: var(--radius); }
.material-strip img { height: 130px; width: auto; flex: 0 1 auto; min-width: 0; object-fit: contain; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.material-strip:hover img { border-color: var(--brand); }
@media (max-width: 600px) { .material-strip img { height: 90px; } .material-strip img:nth-child(n+4) { display: none; } }

/* Keep jump-to-section headings clear of the sticky menu bar */
[id] { scroll-margin-top: 84px; }

/* Yellow placeholder boxes - delete these once real content is added */
.todo { background: var(--todo-bg); border: 2px dashed var(--todo-line); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; color: #5a4a00; font-size: .95rem; }
.todo::before { content: "CONTENT NEEDED: "; font-weight: 700; }
.draft { background: #eef3ff; border: 1px solid #b9c8f0; border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; color: #2b3f78; margin: 16px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: #dfe9e6; padding: 40px 0 24px; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.site-footer h4 { color: #fff; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }
.footer-base { border-top: 1px solid rgba(255,255,255,.2); margin-top: 28px; padding-top: 16px; font-size: .85rem; opacity: .8; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1, .hero h1 { font-size: 1.8rem; }
  .hero { padding: 40px 0; }
}
