/* ============================================================================
   Aoe2MG Theme — CSS estructural (reset, layout, header del theme, footer).
   El plugin aoe2mg-core provee las variables medievales y los estilos del
   header/dashboard del plugin. Este CSS controla el envoltorio del theme:
   reset, tipografía base, layout del <main>, footer, y pequeños detalles
   de páginas (front, page, single, 404, archive).
   ============================================================================ */

/* ----- Reset mínimo ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--aoe2mg-bg, #1a1410);
  color: var(--aoe2mg-text, #f1e6d2);
  font-family: var(--aoe2mg-font-body, "Segoe UI", system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--aoe2mg-accent, #fcab59);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover,
a:focus {
  color: var(--aoe2mg-accent-dim, #c9843d);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--aoe2mg-font-display, Georgia, serif);
  color: var(--aoe2mg-text, #f1e6d2);
  margin: 0 0 0.6em 0;
  line-height: 1.25;
}

p {
  margin: 0 0 1em 0;
}

/* ----- Site wrapper ------------------------------------------------------- */
.aoe2mg-site {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.aoe2mg-main {
  flex: 1 0 auto;
  width: 100%;
}

/* ----- Header del theme (envoltorio) --------------------------------------
   El header funcional (logo, nav, login) lo pinta el plugin core con su
   propio CSS. Aquí solo dejamos que el theme lo aloje en la parte de
   arriba del <main>. El plugin core ya le da fondo y borde. */

.aoe2mg-site > .aoe2mg-header {
  flex: 0 0 auto;
}

/* ----- Front page --------------------------------------------------------- */
.aoe2mg-frontpage {
  /* El dashboard del plugin core ya tiene su propio padding/max-width;
       este envoltorio solo añade un poco de aire vertical en la home. */
  padding-top: 8px;
}

/* Aviso de plugin desactivado (fallback de front-page.php) */
.aoe2mg-frontpage__notice {
  max-width: 800px;
  margin: 40px auto;
  padding: 24px;
  background: var(--aoe2mg-panel, #2b211a);
  border: 1px dashed var(--aoe2mg-border, #4a3a2d);
  border-radius: var(--aoe2mg-radius-lg, 10px);
  color: var(--aoe2mg-text-muted, #b5a48a);
  text-align: center;
}

/* ----- Page (páginas individuales) ---------------------------------------- */
.aoe2mg-page {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 22px;
}

.aoe2mg-page__head {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--aoe2mg-border, #4a3a2d);
  padding-bottom: 14px;
  text-align: center;
}

.aoe2mg-page__title {
  font-size: 30px;
  color: var(--aoe2mg-accent, #fcab59);
  margin: 0;
}

.aoe2mg-page__body {
  color: var(--aoe2mg-text, #f1e6d2);
}

/* ----- Single post -------------------------------------------------------- */
.aoe2mg-single {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 22px;
}

.aoe2mg-single__head {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--aoe2mg-border, #4a3a2d);
  padding-bottom: 14px;
}

.aoe2mg-single__title {
  font-size: 28px;
  color: var(--aoe2mg-accent, #fcab59);
}

.aoe2mg-single__meta {
  color: var(--aoe2mg-text-muted, #b5a48a);
  font-size: 13px;
  margin-top: 8px;
}

.aoe2mg-single__sep {
  margin: 0 8px;
  opacity: 0.6;
}

.aoe2mg-single__body {
  color: var(--aoe2mg-text, #f1e6d2);
}

/* ----- Archive / fallback ------------------------------------------------- */
.aoe2mg-fallback,
.aoe2mg-archive {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 22px;
}

.aoe2mg-fallback__title,
.aoe2mg-archive__title {
  font-size: 26px;
  color: var(--aoe2mg-accent, #fcab59);
  margin-bottom: 16px;
}

.aoe2mg-fallback__list,
.aoe2mg-archive__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.aoe2mg-fallback__item,
.aoe2mg-archive__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--aoe2mg-border, #4a3a2d);
}

.aoe2mg-fallback__link,
.aoe2mg-archive__link {
  font-size: 17px;
  font-weight: 600;
  color: var(--aoe2mg-text, #f1e6d2);
}

.aoe2mg-fallback__link:hover,
.aoe2mg-archive__link:hover {
  color: var(--aoe2mg-accent, #fcab59);
}

.aoe2mg-fallback__excerpt,
.aoe2mg-archive__excerpt {
  color: var(--aoe2mg-text-muted, #b5a48a);
  font-size: 14px;
  margin-top: 4px;
}

.aoe2mg-fallback__empty {
  color: var(--aoe2mg-text-muted, #b5a48a);
  font-style: italic;
}

/* ----- 404 --------------------------------------------------------------- */
.aoe2mg-404 {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 22px;
}

.aoe2mg-404__inner {
  text-align: center;
  max-width: 480px;
}

.aoe2mg-404__code {
  font-family: var(--aoe2mg-font-display, Georgia, serif);
  font-size: 96px;
  color: var(--aoe2mg-accent, #fcab59);
  margin: 0 0 4px 0;
  line-height: 1;
}

.aoe2mg-404__title {
  font-size: 22px;
  color: var(--aoe2mg-text, #f1e6d2);
  margin: 0 0 12px 0;
}

.aoe2mg-404__msg {
  color: var(--aoe2mg-text-muted, #b5a48a);
  margin-bottom: 24px;
}

.aoe2mg-404__btn {
  display: inline-block;
  background: var(--aoe2mg-accent, #fcab59);
  color: #1a1410;
  padding: 10px 22px;
  border-radius: var(--aoe2mg-radius, 6px);
  font-weight: 600;
  text-decoration: none;
}

.aoe2mg-404__btn:hover {
  background: var(--aoe2mg-accent-dim, #c9843d);
  color: #1a1410;
}

/* ----- Footer ------------------------------------------------------------ */
.aoe2mg-footer {
  flex: 0 0 auto;
  background: linear-gradient(
    180deg,
    var(--aoe2mg-bg-alt, #221a14) 0%,
    #100b08 100%
  );
  border-top: 1px solid var(--aoe2mg-border, #4a3a2d);
  color: var(--aoe2mg-text-muted, #b5a48a);
  margin-top: 60px;
}

.aoe2mg-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 22px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.aoe2mg-footer__brand {
  font-family: var(--aoe2mg-font-display, Georgia, serif);
  font-size: 18px;
  color: var(--aoe2mg-accent, #fcab59);
  font-weight: 700;
  text-decoration: none;
}

.aoe2mg-footer__tagline {
  margin-top: 6px;
  font-size: 13px;
  color: var(--aoe2mg-text-muted, #b5a48a);
}

.aoe2mg-footer__heading {
  font-family: var(--aoe2mg-font-display, Georgia, serif);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--aoe2mg-accent-dim, #c9843d);
  margin-bottom: 10px;
}

.aoe2mg-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aoe2mg-footer__list a {
  color: var(--aoe2mg-text-muted, #b5a48a);
  font-size: 13px;
  text-decoration: none;
}

.aoe2mg-footer__list a:hover {
  color: var(--aoe2mg-accent, #fcab59);
}

.aoe2mg-footer__bottom {
  border-top: 1px solid var(--aoe2mg-border, #4a3a2d);
  padding: 14px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--aoe2mg-text-muted, #b5a48a);
}

.aoe2mg-footer__bottom-sep {
  margin: 0 8px;
  opacity: 0.6;
}

@media (max-width: 720px) {
  .aoe2mg-footer__inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
