/* =====================================================
   Gyroholics — site styles
   Change the colours below to restyle the whole site.
   ===================================================== */
:root {
    --navy: #0f2e48;          /* deep sky — top bar, banner */
    --blue: #1d5f8a;          /* rotor blue — buttons, links */
    --blue-hover: #164b6d;
    --sky: #7fb2d8;           /* light blue highlights on navy */
    --silver: #c4ccd4;        /* silver accents */
    --bg: #eef1f4;            /* aluminium page background */
    --card: #ffffff;
    --text: #18242f;
    --muted: #5b6875;
    --line: #d8dee4;
    --error-bg: #fdecec;
    --error-text: #a12626;
    --radius: 10px;
}

/* ----- Fonts (stored in the /fonts folder) ----- */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-700-normal.woff2) format("woff2"); }

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 "Barlow", system-ui, "Segoe UI", sans-serif;
}

a { color: var(--blue); }
h1, h2, h3 { font-family: "Barlow Semi Condensed", "Barlow", sans-serif; font-weight: 700; line-height: 1.15; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; margin: 0 0 .25rem; }
h3 { font-size: 1.15rem; margin: 0 0 .15rem; font-weight: 600; }
code { background: #e3e8ed; padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 32px; padding-bottom: 48px; }

/* ----- Top bar ----- */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
    display: flex; align-items: center; gap: 10px;
    color: #fff; text-decoration: none;
    font: 700 1.5rem/1 "Barlow Semi Condensed", sans-serif; letter-spacing: .01em;
}
.logo img { width: 40px; height: 40px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a, .topbar .link-btn { color: #dfe7ee; }
.topbar nav a:hover, .topbar .link-btn:hover { color: #fff; }
.hello { color: var(--silver); }
.hello strong { color: #fff; }
.inline { display: inline; margin: 0; }

/* ----- Search ----- */
.forums-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.forums-head .section-title { margin: 0; }
.forum-search { position: relative; width: 300px; max-width: 100%; }
.forum-search input {
    width: 100%; height: 40px; padding: 0 42px 0 16px; border-radius: 99px; border: 1px solid var(--line);
    background: var(--card); font: inherit; font-size: .95rem; color: var(--text);
}
.forum-search input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
.forum-search button { position: absolute; right: 5px; top: 5px; width: 30px; height: 30px; border: 0; border-radius: 50%;
                       background: #ffc61a; color: #13283f; cursor: pointer; display: grid; place-items: center; }
.forum-search button:hover { background: #ffd447; }
.forum-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.search-page-form { display: flex; gap: 10px; margin: 8px 0 20px; max-width: 640px; }
.search-page-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.search-result .snippet { margin: 8px 0 0; color: var(--text); font-size: .95rem; }
mark { background: #ffe27a; color: inherit; padding: 0 2px; border-radius: 3px; }

/* ----- Buttons ----- */
.btn {
    display: inline-block; background: var(--blue); color: #fff;
    border: 0; border-radius: 8px; padding: 11px 20px;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-hover); }
.btn.small { padding: 6px 13px; font-size: .92rem; }
.btn.full { width: 100%; }
.btn.silver { background: linear-gradient(#ffffff, #c9d1d9); color: var(--navy); }
.btn.silver:hover { background: linear-gradient(#ffffff, #dde3e9); }
.btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(196, 204, 212, .6); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.topbar .btn.small { background: var(--silver); color: var(--navy); }
.topbar .btn.small:hover { background: #fff; }
.link-btn { background: none; border: 0; color: var(--blue); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ----- Home page banner: the cartoon gyro scene ----- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    min-height: clamp(440px, 36vw, 600px);
    display: flex; align-items: center;
    background: #5f8cc0;                 /* the scene's sky, shown while the picture loads */
}
.hero-scene img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: right center;
}
/* darken the left of the scene a little so the welcome text is easy to read */
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, rgba(12, 34, 60, .78) 0%, rgba(12, 34, 60, .55) 26%, rgba(12, 34, 60, 0) 46%);
}
.hero-text {
    position: relative; z-index: 2;
    width: min(440px, 36vw);
    margin-left: max(24px, calc((100vw - 980px) / 2 - 40px));
    padding: 48px 0 78px;
}
.hero h1 {
    font-size: clamp(2.5rem, 4vw, 3.9rem); line-height: 1; letter-spacing: -.01em;
    margin: 0 0 18px; text-shadow: 0 2px 0 rgba(12, 34, 60, .35);
}
.hero-lead { font-size: 1.1rem; line-height: 1.55; color: #f2f6fa; margin: 0 0 26px; text-shadow: 0 1px 2px rgba(12, 34, 60, .5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-count { margin: 22px 0 0; color: #ffe27a; font-weight: 500; font-size: .98rem; text-shadow: 0 1px 2px rgba(12, 34, 60, .6); }

/* a tilted sticker, like a decal on a hangar door */
.sticker {
    display: inline-block; margin-bottom: 14px; padding: 5px 14px 4px;
    background: #ffc61a; color: #13283f; border-radius: 6px;
    font: 700 1rem/1.2 "Barlow Semi Condensed", sans-serif; letter-spacing: .02em;
    transform: rotate(-4deg); box-shadow: 0 3px 0 #c98700, 0 6px 14px rgba(0, 0, 0, .25);
}

/* sunshine-yellow button in the gyro's own paint colour */
.btn.sun {
    background: #ffc61a; color: #13283f;
    box-shadow: 0 4px 0 #c98700; transform: translateY(0);
    transition: transform .12s, box-shadow .12s;
}
.btn.sun:hover { background: #ffd447; transform: translateY(-2px); box-shadow: 0 6px 0 #c98700; }
.btn.sun:active { transform: translateY(2px); box-shadow: 0 2px 0 #c98700; }
.hero .btn.ghost { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .14); }

/* wavy edge where the scene meets the page */
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 46px; z-index: 2; fill: var(--bg); }

/* ----- About section ----- */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; margin-bottom: 48px; }
.about h2 { font-size: 1.6rem; margin-bottom: 10px; }
.about p { margin: 0 0 14px; max-width: 38em; }
.rules { background: var(--card); border-left: 5px solid #ffc61a; border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px; align-self: start; }
.rules ul { margin: 0; padding-left: 1.1em; }
.rules li { margin-bottom: 8px; }
.section-title { font-size: 1.6rem; margin-bottom: 14px; }

/* ----- Category icons on the home page ----- */
.cat-row { justify-content: flex-start; }
.cat-row .row-main { flex: 1; }
.cat-icon {
    flex: none; width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center;
}
.cat-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tone-0 { background: #fff1bf; color: #9a6500; }
.tone-1 { background: #dcebfa; color: #1d5f8a; }
.tone-2 { background: #e1f0d3; color: #3d7a2a; }
.tone-3 { background: #fde3d6; color: #b4471f; }
.tone-4 { background: #e7e3f6; color: #5a4a9c; }
.cat-row:hover .cat-icon { transform: rotate(-6deg); }
.cat-icon { transition: transform .15s; }
@media (prefers-reduced-motion: reduce) { .cat-icon, .btn.sun { transition: none; } }

/* ----- Lists of categories / threads ----- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 20px; color: inherit; text-decoration: none;
}
.row:hover { border-color: var(--blue); }
.row-main { min-width: 0; }
.row-main p { margin: 0; }
.row-stats { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; font-size: .95rem; }

/* ----- Cards & forms ----- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; margin-top: 16px;
}
.card.narrow { max-width: 440px; margin: 20px auto; }
.empty { text-align: center; color: var(--muted); }
label { display: block; font-weight: 600; margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], textarea {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; margin-bottom: 12px; }
.error { background: var(--error-bg); color: var(--error-text); padding: 10px 14px; border-radius: 8px; }
.warning { background: #fff6dd; padding: 10px 14px; border-radius: 8px; }

/* ----- Posts ----- */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-top: 12px; }
.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}
.post-body { overflow-wrap: anywhere; }
.tag { font-size: .8rem; background: #e2ebf3; color: var(--blue); padding: 2px 9px; border-radius: 99px; }

/* ----- Photos ----- */
.gallery { display: grid; gap: 8px; margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.count-1 { grid-template-columns: minmax(0, 560px); }
.gallery.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery a { display: block; border-radius: 8px; overflow: hidden; background: var(--bg); aspect-ratio: 4 / 3; }
.gallery.count-1 a { aspect-ratio: auto; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery.count-1 img { height: auto; }
.gallery a:hover img { opacity: .92; }
.photo-field { font-weight: 600; margin: 4px 0 16px; }
.photo-field input { display: block; margin-top: 8px; font: inherit; font-weight: 400; }
.field-title { font-weight: 600; margin: 4px 0 8px; }
.photo-edit { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.photo-choice { margin: 0; font-weight: 400; display: flex; flex-direction: column; gap: 6px; }
.photo-choice img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; display: block; }
.photo-choice span { font-size: .9rem; }

/* ----- Moderation ----- */
.badge { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; vertical-align: 2px; }
.badge.mod { background: #e2ebf3; color: var(--blue); }
.badge.admin { background: var(--navy); color: #fff; }
.post-tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .92rem; }
.post-tools .muted { margin-right: auto; }
.link-btn.danger { color: var(--error-text); }
.cancel { margin-left: 14px; }
.notice { background: #e2ebf3; color: var(--navy); padding: 10px 14px; border-radius: 8px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.members { width: 100%; border-collapse: collapse; font-size: .95rem; }
.members th, .members td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.members th { font-weight: 600; color: var(--muted); background: #f6f8fa; }
.members tr:last-child td { border-bottom: 0; }
.members tr.is-banned td { color: var(--muted); text-decoration: line-through; }
.members tr.is-banned td:last-child { text-decoration: none; }
.role-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.role-form select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ----- Move thread (moderators) ----- */
.move { position: relative; }
.move summary { cursor: pointer; color: var(--blue); text-decoration: underline; list-style: none; }
.move summary::-webkit-details-marker { display: none; }
.move-form { position: absolute; right: 0; top: 28px; z-index: 5; display: flex; gap: 8px; align-items: center;
             background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.move-form select { margin: 0; max-width: 240px; }
.move-form .btn { white-space: nowrap; }

/* ----- Password reset ----- */
.flash { margin: 16px 0 0; }
.reset-box { margin-bottom: 16px; }
.reset-box p { margin: 0 0 8px; }
.reset-box input { width: 100%; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ----- Admin area ----- */
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 99px; background: #c4572b; color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.5; text-align: center; vertical-align: 1px; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; border-bottom: 2px solid var(--line); margin: -8px 0 24px; }
.admin-tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.stat dt { color: var(--muted); font-size: .9rem; }
.stat dd { margin: 0; }
.stat dd:first-of-type { font: 700 1.9rem/1.2 "Barlow Semi Condensed", sans-serif; color: var(--navy); }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-cols .card { margin-top: 0; }
.plain-list { list-style: none; margin: 10px 0; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list li.unread a { font-weight: 700; }
.recent-posts .snippet { flex-basis: 100%; color: var(--muted); font-size: .92rem; }
.message-row.unread { border-left: 4px solid var(--blue); }
.message-row.unread h3 { color: var(--navy); }
.message-view h1 { font-size: 1.5rem; }
.message-view .post-body { margin: 16px 0; }
.message-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.cat-edit { margin-top: 0; padding: 16px 20px; }
.cat-form { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: end; }
.cat-form label { margin: 0; font-size: .9rem; }
.cat-form input[type=number] { display: block; width: 100%; margin-top: 6px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; }
.cat-form .btn { padding: 10px 16px; }
.cat-foot { display: flex; gap: 16px; margin-top: 8px; }
.cat-parent { grid-column: 1 / 3; font-size: .9rem; }
.cat-parent select { width: 100%; }
.cat-staff { grid-column: 3 / -1; align-self: end; font-weight: 400; font-size: .92rem; display: flex; gap: 8px; align-items: center; padding-bottom: 10px; }
.cat-edit.depth-1 { margin-left: 40px; border-left: 4px solid #dcebfa; }
.cat-edit.depth-2 { margin-left: 80px; border-left: 4px solid #e1f0d3; }

/* region tags under "Around the World", and whole-row links */
.cat-row { position: relative; }
.row-link { color: inherit; text-decoration: none; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.row-link:focus-visible { outline: none; }
.row-link:focus-visible::after { outline: 3px solid var(--sky); outline-offset: 2px; }
.subcats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0 !important; position: relative; z-index: 1; }
.subcats a { font-size: .85rem; padding: 3px 10px; border-radius: 99px; background: #eef4fa; color: var(--blue); text-decoration: none; border: 1px solid #d6e4f1; }
.subcats a:hover { background: #dcebfa; }
.add-title { margin-top: 28px; }
.threads-title { margin-top: 28px; font-size: 1.3rem; }
.card.wide { max-width: 620px; }
select { font: inherit; font-weight: 400; display: block; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.post-tools .report { color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ----- Misc ----- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-head p { margin: 0; }
.crumbs { font-size: .92rem; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.pager { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.pager a { padding: 4px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); text-decoration: none; }
.pager a.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.footer { color: var(--muted); font-size: .88rem; padding-bottom: 30px; }

/* ----- Phones & tablets ----- */
@media (max-width: 1180px) {
    .hero { display: flex; flex-direction: column-reverse; align-items: stretch; min-height: 0;
            background: linear-gradient(180deg, #2f5f96 0%, #4b7db6 70%, #5f8cc0 100%); }
    .hero::before { display: none; }
    .hero-scene img { position: static; display: block; width: 100%; height: auto; }
    .hero-text { width: auto; max-width: 980px; margin: 0 auto; box-sizing: border-box;
                 padding: 36px max(20px, calc((100vw - 980px) / 2 + 16px)) 18px; }
    .hero-lead { max-width: 40em; }
    .hero-wave { height: 28px; }
}
@media (max-width: 820px) {
    .about { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 700px) {
    .admin-cols { grid-template-columns: 1fr; }
    .cat-form { grid-template-columns: 70px minmax(0, 1fr); }
    .cat-form .cat-desc, .cat-parent, .cat-staff { grid-column: 1 / -1; }
    .cat-edit.depth-1 { margin-left: 14px; }
    .cat-edit.depth-2 { margin-left: 28px; }
}
@media (max-width: 600px) {
    .gallery.count-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery.count-3 a:first-child { grid-column: 1 / -1; }
    .row { flex-direction: column; align-items: flex-start; }
    .cat-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
    .cat-row .row-main { flex: 1 1 0; min-width: 0; }
    .cat-row .row-stats { flex-basis: 100%; }
    .cat-icon { width: 44px; height: 44px; border-radius: 12px; }
    .cat-icon svg { width: 24px; height: 24px; }
    .row-stats { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 10px; }
    .page-head { flex-direction: column; }
    .hello { display: none; }
    .forums-head { flex-wrap: wrap; }
    .forum-search { width: 100%; }
    .logo { font-size: 1.3rem; }
    .logo img { width: 34px; height: 34px; }
}
