/*
Theme Name: Life Archive Theme
Theme URI: https://example.com/life-archive-theme
Author: David
Description: A clean full site editing theme designed for the Life Archive plugin.
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Version: 0.1.8
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: life-archive-theme
Tags: full-site-editing, blog, one-column, custom-colors, custom-logo, editor-style
*/

:root {
  --la-border: #e6e1d8;
  --la-soft: #f7f4ef;
  --la-softer: #fbfaf8;
  --la-ink: #1f2933;
  --la-muted: #5f6b76;
  --la-accent: #5b6f8f;
  --la-accent-dark: #34435e;
}

body {
  background: #ffffff;
}

.wp-site-blocks {
  min-height: 100vh;
}

a {
  text-underline-offset: 0.18em;
}

.la-theme-site-header {
  border-bottom: 1px solid var(--la-border);
}

.la-theme-site-footer {
  border-top: 1px solid var(--la-border);
}

.la-theme-site-header,
.la-theme-site-footer {
  padding-left: 40px;
  padding-right: 40px;
  box-sizing: border-box;
}

@media (max-width: 700px) {
  .la-theme-site-header,
  .la-theme-site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.la-theme-panel,
.la-theme-card,
.life-archive-entry-card,
.life-archive-context-nav,
.life-archive-index-list,
.life-archive-empty {
  background: var(--la-softer);
  border: 1px solid var(--la-border);
  border-radius: 18px;
}

.la-theme-panel {
  padding: clamp(1.25rem, 2vw, 2rem);
}

.la-theme-card,
.life-archive-entry-card,
.life-archive-context-nav,
.life-archive-empty {
  padding: 1.15rem;
}

.la-theme-hero {
  border-bottom: 1px solid var(--la-border);
}

.la-theme-muted,
.life-archive-entry-meta,
.life-archive-entry-summary,
.life-archive-context-label,
.life-archive-empty {
  color: var(--la-muted);
}

.life-archive-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.life-archive-entry-card h3,
.life-archive-entry-title {
  margin-top: 0;
}

.life-archive-entry-card a,
.life-archive-context-nav a,
.life-archive-index-list a {
  color: var(--la-accent-dark);
}

.life-archive-index-list {
  list-style: none;
  padding: 1rem;
  margin-left: 0;
}

.life-archive-index-list li + li {
  margin-top: 0.35rem;
}

.life-archive-context-nav {
  margin-top: 2rem;
}

.life-archive-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.la-theme-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.la-theme-card {
  height: 100%;
}

.la-theme-card p:last-child,
.la-theme-panel p:last-child {
  margin-bottom: 0;
}

.wp-block-button .wp-block-button__link {
  border-radius: 999px;
}

.wp-block-post-content > * + * {
  margin-block-start: 1.1rem;
}

@media (max-width: 760px) {
  .la-theme-site-header .wp-block-navigation {
    font-size: 0.95rem;
  }

  .life-archive-context-links {
    display: block;
  }

  .life-archive-context-links > * + * {
    margin-top: 0.7rem;
  }
}


.la-theme-entry-taxonomies {
  background: var(--la-softer);
  border: 1px solid var(--la-border);
  border-radius: 18px;
}

.la-theme-term-row {
  border-top: 1px solid var(--la-border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.la-theme-term-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.la-theme-term-label {
  margin-bottom: 0.25rem;
  color: var(--la-muted);
  font-size: 0.92rem;
}

.la-theme-header-inner,
.la-theme-footer-inner {
  gap: 1rem;
}


/* Front page archive navigation grid. Explicit rules so saved FSE templates render
   the browse cards as cards on the public site, not as a vertical list. */
.la-theme-card-grid,
.wp-site-blocks .la-theme-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 1.1rem !important;
  width: 100%;
  max-width: 1120px;
}

.la-theme-card-grid > .la-theme-card,
.wp-site-blocks .la-theme-card-grid > .wp-block-group,
.wp-site-blocks .la-theme-card-grid > .la-theme-card {
  background: var(--la-softer) !important;
  border: 1px solid var(--la-border) !important;
  border-radius: 18px !important;
  padding: 1.15rem !important;
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
}

.la-theme-card-grid .life-archive-index-list {
  background: transparent;
  border: 0;
  padding: 0;
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .la-theme-card-grid,
  .wp-site-blocks .la-theme-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Friendly taxonomy archive headings. */
.la-theme-taxonomy-intro {
  margin-bottom: 1.75rem;
}

.la-theme-taxonomy-intro h1 {
  margin-bottom: 0.35rem;
}

.la-theme-taxonomy-subtitle {
  color: var(--la-muted);
  font-size: 1.05rem;
  margin-top: 0;
}

/* Single entry archive-link grid. */
.la-theme-entry-term-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.la-theme-entry-term-card {
  background: var(--la-softer);
  border: 1px solid var(--la-border);
  border-radius: 18px;
  padding: 1rem;
}

.la-theme-entry-term-card h2 {
  font-size: 1rem;
  margin: 0 0 0.55rem;
}

.la-theme-entry-term-card p {
  margin: 0;
}

.la-theme-entry-term-card a {
  color: var(--la-accent-dark);
}

@media (max-width: 700px) {
  .la-theme-entry-term-grid {
    grid-template-columns: 1fr;
  }
}



/* Fixed home archive card grid: keep Life Stages, Topics and People aligned. */
.la-theme-home-archive-grid,
.wp-site-blocks .la-theme-home-archive-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 1.1rem !important;
  width: 100% !important;
  max-width: 1120px !important;
}

.la-theme-home-archive-grid > .wp-block-group,
.la-theme-home-archive-grid > .la-theme-card,
.wp-site-blocks .la-theme-home-archive-grid > .wp-block-group,
.wp-site-blocks .la-theme-home-archive-grid > .la-theme-card {
  align-self: stretch !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.la-theme-home-archive-grid .la-theme-card,
.wp-site-blocks .la-theme-home-archive-grid .la-theme-card {
  display: flex !important;
  flex-direction: column !important;
}

.la-theme-home-archive-grid .life-archive-index-list,
.wp-site-blocks .la-theme-home-archive-grid .life-archive-index-list {
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 899px) {
  .la-theme-home-archive-grid,
  .wp-site-blocks .la-theme-home-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .la-theme-home-archive-grid,
  .wp-site-blocks .la-theme-home-archive-grid {
    grid-template-columns: 1fr !important;
  }
}
