/* ============================================================
   Vivre à Toulouse — Minimalist City Theme
   ============================================================ */

/* ---- Reset & base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg:       #fafaf8;
    --color-surface:  #ffffff;
    --color-border:   #e8e6e0;
    --color-text:     #1a1a18;
    --color-muted:    #6b6b65;
    --color-accent:   #c1440e;   /* terracotta — La Ville Rose */
    --color-accent-h: #a33608;
    --radius:         4px;
    --radius-lg:      8px;
    --shadow:         0 1px 4px rgba(0,0,0,.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --font:           system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --max-w:          1140px;
    --transition:     .18s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent); }

img { max-width: 100%; display: block; }

/* ---- Layout ---------------------------------------------- */
.container {
    width: min(var(--max-w), 100% - 2.5rem);
    margin-inline: auto;
}

.section { padding: 4rem 0; }
.section--alt { background: var(--color-surface); }

/* ---- Header ---------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #16161a;
    border-bottom: 1px solid #2a2a30;
    padding: .85rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}

.logo-mark { color: var(--color-accent); font-size: 1rem; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-left: auto;
}

.nav-silo {
    font-size: .8rem;
    font-weight: 500;
    color: #ccc;
    padding: .35rem .8rem;
    border-radius: 100px;
    border: 1px solid transparent;
    transition: var(--transition);
    letter-spacing: .01em;
}

.nav-silo:hover,
.nav-silo[aria-current="page"] {
    background: var(--silo-color, #888);
    color: #fff;
    border-color: var(--silo-color, #888);
}

/* ---- Hero ------------------------------------------------ */
.hero {
    background: #16161a;
    padding: 5rem 0 4.5rem;
    text-align: center;
    border-bottom: 1px solid #2a2a30;
}

.hero--image {
    position: relative;
    padding: 7rem 0 6.5rem;
    background: url('/public/images/toulouse.png') center / cover no-repeat;
    border-bottom: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(22, 22, 26, .72) 0%,
        rgba(22, 22, 26, .55) 50%,
        rgba(22, 22, 26, .80) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.03em;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.hero-sub {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #ddd;
    max-width: 560px;
    margin-inline: auto;
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
}

/* ---- Section title --------------------------------------- */
.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -.02em;
    margin-bottom: 1.75rem;
    color: var(--color-text);
}

.section-title::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2px;
    background: var(--color-accent);
    margin-top: .45rem;
}

/* ---- Silo grid (home) ------------------------------------ */
.silo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.silo-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: 1.5rem 1.4rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--silo-color, #999);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.silo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--silo-color, #999);
}

.silo-icon { font-size: 1.6rem; }

.silo-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}

.silo-count {
    font-size: .78rem;
    color: var(--color-muted);
}

/* ---- Page card grid -------------------------------------- */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}

.page-card {
    display: block;
    padding: 1.4rem 1.4rem 1.2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--silo-color, var(--color-accent));
}

.page-card--hub   { border-left: 3px solid var(--silo-color, var(--color-accent)); }
.page-card--priority { border-left: 3px solid var(--silo-color, var(--color-accent)); }

.page-card-silo {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    display: block;
    margin-bottom: .45rem;
}

.page-card-title {
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: .5rem;
    color: var(--color-text);
}

.page-card-meta {
    font-size: .82rem;
    color: var(--color-muted);
    line-height: 1.5;
}

.page-card-date {
    margin-top: auto;
    padding-top: .5rem;
    font-size: .75rem;
    color: var(--color-muted);
}

.page-card-badges { margin-top: .75rem; display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---- Badges ---------------------------------------------- */
.badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 100px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.badge--hub      { background: #fff3cd; color: #7a5000; }
.badge--priority { background: #d4edda; color: #1a5c2a; }
.badge--links    { background: #e8f0fe; color: #1a3c8a; }

/* ---- Hub list (home) ------------------------------------- */
.hub-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.hub-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
}

.hub-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

.hub-dot {
    flex-shrink: 0;
    width: 10px; height: 10px;
    border-radius: 50%;
}

.hub-incoming {
    margin-left: auto;
    font-size: .75rem;
    color: var(--color-muted);
    font-weight: 400;
}

/* ---- Silo hero page -------------------------------------- */
.silo-hero {
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(135deg, #16161a 0%, #22222a 100%);
}

.silo-hero h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -.025em;
    margin-top: .6rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.silo-icon-lg { font-size: 2rem; }
.silo-hero-sub { color: #aaa; margin-top: .6rem; font-size: .95rem; }

/* ---- Breadcrumb ------------------------------------------ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    color: #888;
    margin-bottom: .75rem;
}

.breadcrumb a { color: #aaa; }
.breadcrumb a:hover { color: #fff; }

/* Breadcrumb on white bg (article pages) */
.page-article .breadcrumb { margin: 2rem 0 0; color: var(--color-muted); }
.page-article .breadcrumb a { color: var(--color-muted); }
.page-article .breadcrumb a:hover { color: var(--color-accent); }

/* ---- Article page ---------------------------------------- */
.page-article { padding-bottom: 5rem; }

.article-header {
    padding: 2rem 0 1.75rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2.5rem;
}

.article-silo-tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--silo-color, var(--color-accent));
    margin-bottom: .75rem;
}

.article-badges { margin-bottom: .75rem; display: flex; gap: .35rem; }

.page-article h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.article-intro {
    font-size: 1.05rem;
    color: var(--color-muted);
    max-width: 680px;
    margin-bottom: .75rem;
}

.article-keyword {
    font-size: .8rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.kw-status {
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 100px;
}

.kw-status--matched  { background: #d4edda; color: #1a5c2a; }
.kw-status--proposed { background: #fff3cd; color: #7a5000; }

.article-body {
    max-width: 720px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.content-placeholder {
    color: var(--color-muted);
    font-style: italic;
    padding: 2.5rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

/* ---- Related links --------------------------------------- */
.article-links {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    max-width: 720px;
}

.article-links-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -.01em;
}

.related-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.related-link {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .88rem;
    transition: var(--transition);
}

.related-link:hover { border-color: var(--color-accent); }

.related-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.related-anchor {
    font-weight: 500;
    color: var(--color-text);
}

.related-title {
    font-size: .75rem;
    color: var(--color-muted);
    text-align: right;
    max-width: 240px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---- Footer ---------------------------------------------- */
.site-footer {
    background: #16161a;
    color: #999;
    padding: 2rem 0;
    font-size: .82rem;
    border-top: 1px solid #2a2a30;
}

.footer-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-size: .9rem;
    font-weight: 600;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.footer-logo:hover { color: #fff; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-left: auto;
}

.footer-nav-link {
    font-size: .78rem;
    color: #666;
    padding: .25rem .65rem;
    border-radius: 100px;
    border: 1px solid #2a2a30;
    transition: var(--transition);
}

.footer-nav-link:hover { color: #ccc; border-color: #444; }

.footer-copy {
    border-top: 1px solid #2a2a30;
    padding-top: 1.5rem;
    color: #555;
    font-size: .78rem;
}

/* ---- 404 ------------------------------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.error-inner { text-align: center; padding: 2rem; }

.error-code {
    display: block;
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-accent);
    letter-spacing: -.05em;
}

.error-inner h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
.error-inner p  { color: var(--color-muted); margin-bottom: 2rem; }

.btn {
    display: inline-block;
    padding: .7rem 1.6rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .9rem;
    transition: var(--transition);
}

.btn:hover { background: var(--color-accent-h); color: #fff; }

/* ---- Auth nav -------------------------------------------- */
.site-auth {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: .5rem;
}

.auth-user {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: #aaa;
}

.auth-role { font-size: .85rem; }
.auth-role--admin  { color: #f6ad55; }
.auth-role--reader { color: #76e4f7; }

.auth-link {
    font-size: .75rem;
    font-weight: 600;
    padding: .3rem .75rem;
    border-radius: 100px;
    border: 1px solid transparent;
    transition: var(--transition);
    letter-spacing: .02em;
}

.auth-link--in {
    color: #ccc;
    border-color: #3a3a45;
}
.auth-link--in:hover {
    color: #fff;
    border-color: var(--color-accent);
    background: var(--color-accent);
}

.auth-link--out {
    color: #888;
    border-color: #3a3a45;
}
.auth-link--out:hover {
    color: #fff;
    border-color: #555;
    background: #333;
}

/* ---- Login page ------------------------------------------ */
.login-wrap {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    font-size: .95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.login-logo .logo-mark { color: var(--color-accent); }

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.025em;
    margin-bottom: .35rem;
}

.login-sub {
    font-size: .85rem;
    color: var(--color-muted);
    margin-bottom: 1.75rem;
}

.login-error {
    background: #fff0ee;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: .65rem .9rem;
    font-size: .85rem;
    margin-bottom: 1.25rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: .4rem; }

.field label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: .01em;
}

.field input {
    padding: .65rem .85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    transition: var(--transition);
    width: 100%;
}

.field input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(193, 68, 14, .12);
}

.btn--full { width: 100%; justify-content: center; text-align: center; margin-top: .5rem; padding: .75rem; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 640px) {
    .site-header .container { gap: .75rem; }
    .site-nav { gap: .15rem; }
    .nav-silo { font-size: .72rem; padding: .28rem .6rem; }
    .section { padding: 2.5rem 0; }
    .hero { padding: 3rem 0; }
    .related-link { grid-template-columns: 8px 1fr; }
    .related-title { display: none; }
    .footer-cols { gap: 1.5rem; }
}

.edit-page-btn {
    display: inline-block;
    margin-top: .5rem;
    padding: .3rem .8rem;
    font-size: .8rem;
    font-weight: 600;
    color: #c1440e;
    border: 1px solid #c1440e;
    border-radius: 4px;
    text-decoration: none;
    opacity: .7;
    transition: opacity .15s;
}
.edit-page-btn:hover { opacity: 1; }
