/* @font-face rules: web/templates/layout/fonts.html */

:root {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #222222;
    --accent-primary: #FF6600;
    --accent-hover: #e05a00;
    --text-primary: #e8e8e8;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border: #2a2a2a;
    --border-light: #333333;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: 0.25s ease;
    --navbar-height: calc(1.6rem + 61px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.accent { color: var(--accent-primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.btn--primary {
    background: var(--accent-primary);
    color: #111;
    border-color: var(--accent-primary);
}
.btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-light);
}
.btn--ghost:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn--danger {
    background: transparent;
    color: #e55;
    border-color: #e55;
}
.btn--danger:hover { background: #e55; color: #fff; }

.btn--sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn--full { width: 100%; justify-content: center; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.8rem 0;
    background: rgba(17,17,17,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.navbar--scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.nav-lang {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.nav-lang__opt {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    transition: color var(--transition), background var(--transition);
}

.nav-lang__opt:hover { color: var(--text-secondary); }

.nav-lang__opt.active {
    background: var(--accent-primary);
    color: #111;
}

.inline-form {
    margin: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
    justify-self: start;
}

/* Badge shown in place of the wordmark on mobile (see the 1250px query) */
.nav-logo__badge {
    display: none;
    height: 48px;
    width: auto;
}

/* Wordmark logo: dripping Candles "MERLIN'S" over a silver "GARAGE" flanked
   by tapered rules. Shared by the navbar and the home hero (home.css scales
   it up there). */
.brand-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.brand-mark__merlins {
    font-family: 'Candles', var(--font-heading);
    font-size: 2.1rem;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 0 rgba(0,0,0,0.6);
}

.brand-mark__garage {
    display: flex;
    align-items: center;
    gap: 0.45em;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    margin-top: 0.1rem;
    color: var(--text-secondary);
}

.brand-mark__garage::before,
.brand-mark__garage::after {
    content: '';
    width: 1.8em;
    height: 2px;
    background: var(--text-secondary);
}

/* Rules taper to a point away from the word */
.brand-mark__garage::before { clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.brand-mark__garage::after { clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* Merlin's badge (navbar, right side) */
.nav-badge {
    display: flex;
    align-items: center;
    margin-left: 0.75rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--border-light);
    gap: 0.85rem;
    text-decoration: none;
}

.nav-badge__img {
    height: 48px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.nav-badge__text {
    display: flex;
    flex-direction: column;
    padding-left: 0.85rem;
    border-left: 1px solid var(--border-light);
    font-family: 'Barlow Condensed', var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.3;
    white-space: nowrap;
}

.nav-badge__brand {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    color: var(--text-primary);
}

.nav-badge__label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
}

/* Not enough room beside the links + lang/login: keep just the badge */
@media (max-width: 1560px) {
    .nav-badge__text { display: none; }
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.05em;
}

.logo-merlins {
    font-family: 'Candles', var(--font-heading);
    text-transform: none;
    color: var(--accent-primary);
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
}

.logo-garage {
    font-family: 'Montserrat Subrayada', var(--font-heading);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    padding-bottom: 3px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transform-origin: center;
    transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-social {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.85rem;
}

.footer-social__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}

.footer-social__link:hover { color: var(--accent-primary); }

.footer-social__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1;
    gap: 0.15em;
}

.footer-brand__logo {
    height: 110px;
    width: auto;
}

.footer-brand p { color: var(--text-secondary); margin-top: 0.5rem; }

/* Contact details: outlined icon tile + small caps label, matching the
   homepage service icons (orange line icons, Barlow Condensed labels) */
.footer-info {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.1rem;
    width: fit-content;
    padding: 0;
    margin: 0 auto;
}

.footer-info__item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.footer-info__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.footer-info__icon svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-info__item:hover .footer-info__icon { border-color: var(--accent-primary); }

.footer-info__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.footer-info__label {
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-info__body a {
    color: var(--text-secondary);
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color var(--transition);
}

.footer-info__body a:hover { color: var(--accent-primary); }

/* Footer contact form (every page; contact.js shows the flash after a submit) */
.footer-contact { scroll-margin-top: 6rem; }

.footer-contact__title {
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.contact-form .form-input {
    background: var(--bg-primary);
    border-color: var(--border);
    font-size: 0.88rem;
    padding: 0.55rem 0.8rem;
}

.contact-textarea { resize: vertical; min-height: 90px; }

.contact-flash {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.contact-flash--success {
    background: rgba(80,200,80,0.12);
    color: #6d6;
    border: 1px solid rgba(80,200,80,0.25);
}

.contact-flash--error {
    background: rgba(220,50,50,0.12);
    color: #e77;
    border: 1px solid rgba(220,50,50,0.25);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-bottom a:hover { color: var(--accent-primary); }

/* Forms (shared) */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus { border-color: var(--accent-primary); }

/* Replace the native arrow, which sits flush against the border */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px 8px;
    cursor: pointer;
}
.form-textarea { resize: vertical; min-height: 100px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group--check { display: flex; align-items: center; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent-primary); }

.form-actions { margin-top: 1.5rem; }

/* Upload */
.upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.upload-area .form-input { flex: 1; }

.upload-area--dragover {
    outline: 2px dashed var(--accent-primary);
    outline-offset: 4px;
    border-radius: 6px;
}

.image-preview {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-preview img {
    height: 80px;
    width: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    object-fit: cover;
}

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert--error { background: rgba(220,50,50,0.15); border: 1px solid rgba(220,50,50,0.4); color: #e88; }
.alert--success { background: rgba(80,200,80,0.12); border: 1px solid rgba(80,200,80,0.35); color: #8d8; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* Section */
.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

/* Page title */
.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.page-subtitle { color: var(--text-secondary); font-size: 1.1rem; }

/* Responsive */
/* Hide mobile-only extras on desktop */
.nav-mobile-extra { display: none; }

/* Hamburger menu from 1250px down (keep in sync with nav.js). Logged in,
   the extra Dashboard/Logout buttons squeeze the links: below ~1200px the
   Bosnian labels no longer fit on one line. */
@media (max-width: 1250px) {
    .nav-container {
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
    }
    .nav-links {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        gap: 0;
        padding: 0.75rem 0 1.25rem;
        border-bottom: 1px solid var(--border);
        height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
    }
    .nav-links li { padding: 0 1.5rem; }
    .nav-link {
        display: block;
        padding: 0.75rem 0;
    }
    /* Replace stretching underline with colour-only on mobile */
    .nav-link::after { display: none; }
    .nav-link:hover { color: var(--accent-primary); }

    /* Lang + auth row at bottom of mobile dropdown */
    .nav-mobile-extra {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
        padding-top: 0.85rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--border);
    }

    .nav-actions { display: none; }

    /* Collapsed: the badge stands in for the wordmark; nav.js adds
       navbar--open while the dropdown is expanded, bringing the wordmark back */
    .nav-logo .brand-mark { display: none; }
    .nav-logo__badge { display: block; }
    .navbar--open .nav-logo .brand-mark { display: flex; }
    .navbar--open .nav-logo__badge { display: none; }

    /* The dropdown links are absolutely positioned, so without an explicit
       column the toggle would auto-place into the middle track beside the logo */
    .nav-toggle { display: flex; grid-column: 3; justify-self: end; }
}

@media (max-width: 900px) {
    .form-row { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; }
}
