/* Global styles for CatMap version 2. Mobile first. */

:root {
    --bg: #eef2ea;
    --surface: #ffffff;
    --ink: #22332b;
    --ink-soft: #5a6b62;
    --line: #d5ddd2;
    --spruce: #2f6d5a;
    --spruce-dark: #245647;
    --rust: #b0552b;
    --amber: #e08a4e;
}

html {
    background: var(--bg);
}

body {
    font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--ink);
    width: auto;
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 14px 90px 14px;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
    letter-spacing: 0.01em;
    color: var(--ink);
}

h1 { font-size: 1.7em; margin: 0.4em 0; }
h2 { font-size: 1.3em; margin: 0.6em 0; }
h3 { font-size: 1.05em; margin: 1em 0 0.4em 0; }

@media (min-width: 700px) {
    h1 { font-size: 2.1em; }
    h2 { font-size: 1.4em; }
}

a {
    color: var(--spruce);
}

a:hover {
    color: var(--spruce-dark);
}

/* Top header */

.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0 10px 0;
    border-bottom: 2px solid var(--spruce);
    margin-bottom: 16px;
}

.site-logo {
    position: relative;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6em;
    text-decoration: none;
    color: var(--ink);
}

/* Two small cat ears above the logo. */
.site-logo::before,
.site-logo::after {
    content: "";
    position: absolute;
    top: -7px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--spruce);
}

.site-logo::before { left: 2px; transform: rotate(-14deg); }
.site-logo::after  { left: 18px; transform: rotate(14deg); }

.site-nav a {
    margin-left: 14px;
    text-decoration: none;
    color: var(--ink-soft);
}

.site-nav a:hover {
    color: var(--spruce-dark);
    text-decoration: underline;
}

/* Only the page you are on is marked. */
.site-nav .nav-active {
    color: var(--spruce);
    font-weight: bold;
    border-bottom: 2px solid var(--spruce);
    padding-bottom: 2px;
}

.site-nav .nav-active:hover {
    text-decoration: none;
}

/* On small screens the top nav hides, the bottom nav takes over. */
@media (max-width: 700px) {
    .site-nav {
        display: none;
    }
}

/* Bottom navigation for mobile */

.bottom-nav {
    display: none;
}

@media (max-width: 700px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface);
        border-top: 1px solid var(--line);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav a {
        flex: 1;
        text-align: center;
        padding: 14px 4px;
        font-size: 0.85em;
        text-decoration: none;
        color: var(--ink-soft);
    }

    .bottom-nav .nav-active {
        color: var(--spruce);
        font-weight: bold;
        box-shadow: inset 0 3px 0 var(--spruce);
        background: #f0f4ee;
    }
}

/* Flash messages */

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.flash-success {
    border-color: var(--spruce);
    background: #e7f1ec;
}

.flash-error {
    border-color: var(--rust);
    background: #f7e8de;
}

/* Cards */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

@media (min-width: 700px) {
    .card {
        padding: 20px 24px;
    }
}

.card-narrow {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms. Inputs are large enough for touch. */

label {
    display: block;
    margin: 12px 0 4px 0;
    font-size: 0.95em;
    color: var(--ink-soft);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fdfdfc;
    font-family: inherit;
    font-size: 1em;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--spruce);
    outline-offset: 1px;
}

input[type="range"] {
    width: 100%;
}

input[type="file"] {
    width: 100%;
    padding: 8px 0;
}

button,
.button {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--spruce);
    color: #fff;
    font-family: inherit;
    font-size: 1em;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--spruce-dark);
    color: #fff;
}

.button-danger {
    background: var(--rust);
}

.button-danger:hover {
    background: #8f421f;
}

.button-wide {
    display: block;
    width: 100%;
    text-align: center;
}

.button-plain {
    display: block;
    width: 100%;
    background: #fdfdfc;
    color: var(--spruce);
    border: 1px solid var(--line);
}

.button-plain:hover {
    background: #f0f4ee;
    color: var(--spruce-dark);
}

.form-note {
    font-size: 0.9em;
    color: var(--ink-soft);
}

.map-hint {
    font-size: 0.9em;
    color: var(--ink-soft);
    margin: 4px 0;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row > div {
    flex: 1;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    color: #fff;
}

.badge-unknown {
    background: #6b7a72;
}

.badge-missing {
    background: var(--rust);
}

/* Leaflet fine tuning */

.leaflet-container {
    border-radius: 10px;
    border: 1px solid var(--line);
}

/* Shared cat pieces */

.cat-card-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--spruce);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.4em;
    flex-shrink: 0;
}

.photo-delete {
    margin-top: 4px;
    padding: 4px 10px;
    font-size: 0.8em;
    background: var(--rust);
}

/* Footer */

.site-footer {
    margin-top: 30px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.85em;
    color: var(--ink-soft);
}

@media (min-width: 700px) {
    body {
        padding-bottom: 40px;
    }
}
