/* ============================================================
   lamotilla.es — estilos (diseño moderno, responsivo, menú lateral)
   Paleta: pizarra neutro + acento terracota
   ============================================================ */

:root {
    /* Pizarra (reemplaza azul marino y verde) */
    --slate-900: #12161a;
    --slate-800: #1b2126;
    --slate-700: #232a30;
    --slate-600: #313a41;
    --slate-500: #3a444b;

    /* Acento cálido (terracota) para enlaces y acciones */
    --accent: #a4472d;
    --accent-dark: #7c341f;
    --accent-soft: #f5e8e2;

    --cream: #f7f3ec;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #4b5563;
    --border: #e5e0d6;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(18, 22, 26, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--cream);
    line-height: 1.6;
}

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Cabecera ---------- */
.site-header {
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-700) 55%, var(--slate-600) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; gap: 16px;
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.logo-card {
    display: inline-flex; align-items: center;
    background: #fff; border-radius: 10px; padding: 8px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.brand .logo { height: 60px; width: auto; display: block; }
.tagline { color: #c8d2d9; font-size: .9rem; text-align: right; line-height: 1.4; }

/* ---------- Estructura: sidebar + contenido ---------- */
.layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 48px;
    align-items: start;
}

.sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: sticky;
    top: 16px;
}

.search-side { margin-bottom: 14px; }
.search-side input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font: inherit; font-size: .92rem;
}
.search-side input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li + li { border-top: 1px solid var(--border); }
.side-nav a {
    display: block; padding: 10px 12px; color: var(--text);
    border-radius: 6px; font-size: .95rem; font-weight: 500;
}
.side-nav a:hover { background: var(--cream); color: var(--accent); text-decoration: none; }
.side-nav a.active { background: var(--accent); color: #fff; }

.content { min-width: 0; }

/* ---------- Contenido ---------- */
h1 { color: var(--slate-900); font-size: 1.7rem; margin: 0 0 16px; }
h2 { color: var(--slate-900); font-size: 1.25rem; margin: 24px 0 12px; }

.hero {
    background: linear-gradient(135deg, var(--slate-900), var(--slate-600));
    color: #fff; padding: 34px 28px; border-radius: var(--radius); margin-bottom: 24px;
}
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero .lead { margin: 0; color: #c8d2d9; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow);
}

/* ---------- Listas ---------- */
.contact-list, .doc-list, .news-list, .event-list, .board-list, .link-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 4px 0; }
.doc-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list a { font-weight: 500; }
.news-list li { padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; border-bottom: 1px solid var(--border); }
.news-list li:last-child { border-bottom: 0; }

.news-item .meta, .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; }
.muted { color: var(--muted); }
.url { font-size: .85rem; color: var(--muted); word-break: break-all; }

.tag {
    display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
    padding: 2px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600;
}

/* ---------- Chips (filtros) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
    display: inline-block; padding: 6px 14px; border-radius: 30px; background: #fff;
    border: 1px solid var(--border); color: var(--text); font-size: .9rem;
}
.chip.active, .chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; padding: 10px 20px; background: var(--accent); color: #fff;
    border: 0; border-radius: 30px; font-weight: 600; cursor: pointer; font-size: .95rem;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

/* ---------- Galería ---------- */
.gallery { margin-bottom: 32px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-item { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.gallery-item img { width: 100%; height: 110px; object-fit: cover; display: block; transition: transform .15s; }
.gallery-item:hover img { transform: scale(1.04); }

/* ---------- Documentos por año ---------- */
.doc-years { display: grid; gap: 18px; }
.doc-year { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.doc-year h2 { margin: 0 0 8px; font-size: 1.1rem; }

/* ---------- Calendario ---------- */
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-nav strong { color: var(--slate-900); font-size: 1.1rem; }
.calendar { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.calendar th, .calendar td { border: 1px solid var(--border); padding: 10px; text-align: center; }
.calendar th { background: var(--slate-900); color: #fff; }
.calendar td.today { background: var(--accent); color: #fff; font-weight: 700; }
.calendar td.empty { background: #faf8f3; }

/* ---------- Formularios ---------- */
.form p { margin: 0 0 14px; }
.form label { display: block; font-weight: 600; margin-bottom: 4px; }
.form input, .form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-big { display: flex; gap: 8px; margin-bottom: 18px; }
.search-big input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }

.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.notice.success { background: var(--accent-soft); color: var(--accent-dark); }
.notice.error { background: #fdecea; color: #b00020; }
.notice ul { margin: 0; padding-left: 18px; }

/* ---------- Contenido de páginas ---------- */
.page-content .body { overflow-x: auto; }
.page-content table { border-collapse: collapse; width: 100%; }
.page-content table td, .page-content table th { border: 1px solid var(--border); padding: 8px; }

/* ---------- Pie ---------- */
.site-footer {
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-700) 55%, var(--slate-600) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #c8d2d9; margin-top: 40px; padding: 26px 0;
}
.site-footer p { margin: 0 0 8px; }
.footer-links { list-style: none; display: flex; gap: 16px; padding: 0; margin: 0 0 8px; flex-wrap: wrap; }
.footer-links a { color: #fff; }
.footer-links a:hover { color: #e8a98f; }
.copyright { font-size: .85rem; color: #9fb0bd; }

/* ---------- Banner de cookies ---------- */
#cajacookies {
    position: fixed; bottom: 0; left: 0; right: 0; background: #f2e3d4; color: var(--slate-900);
    padding: 16px 20px; align-items: center; gap: 16px; flex-wrap: wrap;
    box-shadow: 0 -0.4rem 1rem rgba(0,0,0,.12); z-index: 900;
}
#cajacookies p { margin: 0; flex: 1; min-width: 240px; }
#cajacookies a { color: var(--accent-dark); }
#btn-cookies {
    background: var(--slate-900); color: #fff; border: 0; border-radius: 30px; padding: 9px 20px; cursor: pointer; font-weight: 700;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid-2 { grid-template-columns: 1fr; }
    .calendar th, .calendar td { padding: 7px 4px; font-size: .85rem; }
}
