/*
Theme Name: Ashridge Blog v4
Description: A standalone WordPress theme for the Ashridge Trees blog. Mobile-first, fully responsive, matching the ashridgetrees.co.uk brand.
Author: Ashridge Trees Ltd
Author URI: https://www.ashridgetrees.co.uk
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ashridge-blog
Tags: blog, mobile-first, responsive, green, nature
*/

/* ============================================================
   ASHRIDGE BLOG THEME — Mobile First
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --green:        #3a5c2e;
  --green-dark:   #2d4722;
  --green-light:  #f0f4ed;
  --maroon:       #693c5e;
  --maroon-dark:  #52304b;
  --amber:        #c47c2b;
  --amber-light:  #f5a623;
  --text:         #1a1a1a;
  --muted:        #666;
  --border:       #e2e2e2;
  --white:        #fff;
  --bg:           #f7f6f2;
  --card:         #fff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', Helvetica, sans-serif;

  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  14px;
  --r-xl:  20px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);

  --max-w: 1200px;
  --header-h: 64px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }
ul { list-style: none; }

/* ── Announcement Bar ─────────────────────────────────────── */
#ashridge-announcement {
  background: var(--maroon);
  color: rgba(255,255,255,.9);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  padding: .45rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem 2rem;
  flex-wrap: wrap;
}
#ashridge-announcement .stars { color: var(--amber-light); }

/* ── Header ───────────────────────────────────────────────── */
#ashridge-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 200;
	padding-top:1rem;
	padding-bottom:1rem;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
	background-color:#ffffff;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.site-logo img {
  min-height: 44px;
  width: auto;
  display: block;
	padding:10px 0;
}
.site-logo .text-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1.1;
}
.site-logo .text-logo span {
  display: block;
  font-size: .65rem;
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Search — hidden on mobile, shown on desktop */
.header-search {
  flex: 1;
  max-width: 400px;
  display: none;
}
.header-search form {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color .2s;
}
.header-search form:focus-within { border-color: var(--green); }
.header-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .5rem 1rem;
  font-family: var(--font-body);
  font-size: .875rem;
  background: transparent;
}
.header-search button {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: .5rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.header-search button:hover { background: var(--green-dark); }

/* Hamburger */
#menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
#menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
#menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav Drawer — mobile full width, desktop dropdown ─────── */
#ashridge-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  width: 100%;
}
#ashridge-nav.open { max-height: 700px; }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .75rem 1rem 1rem;
}

/* Search inside nav */
.nav-search { margin-bottom: .75rem; }
.nav-search form {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.nav-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .55rem 1rem;
  font-family: var(--font-body);
  font-size: .875rem;
}
.nav-search button {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: .5rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Nav menu items */
#primary-menu {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
#primary-menu li a {
  display: block;
  padding: .7rem 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color .2s, padding-left .2s;
}
#primary-menu li:last-child a { border-bottom: none; }
#primary-menu li a:hover { color: var(--green); padding-left: .5rem; }
#primary-menu li.current-menu-item a { color: var(--green); }
#primary-menu .shop-link a { color: var(--green); }

/* ── Desktop Nav ─────────────────────────────────────────── */
@media (min-width: 768px) {
  #menu-toggle { display: flex; }
  .header-search { display: block; }
  .nav-search { display: none; }

  /* On desktop, nav is positioned relative to the whole page
     so it drops below the header bar full width */
  #ashridge-nav {
    position: relative;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  #ashridge-nav.open { max-height: 500px; }

  .nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: .5rem 1.5rem;
  }

  #primary-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  #primary-menu li a {
    padding: .5rem .85rem;
    font-size: .875rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

  #primary-menu li:last-child a { border-right: none; }

  #primary-menu li a:hover {
    background: var(--green-light);
    color: var(--green);
    padding-left: .85rem;
  }

  #primary-menu li.current-menu-item a { color: var(--green); font-weight: 700; }
}

/* ── Main Layout ─────────────────────────────────────────── */
#ashridge-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  overflow: hidden; /* prevent sidebar blowout */
}

@media (min-width: 768px) {
  #ashridge-main { padding: 2rem 1.5rem; overflow: visible; }
}

@media (min-width: 1024px) {
  #ashridge-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    align-items: start;
    padding: 2.5rem 1.5rem;
  }
}

/* Prevent any content inside primary from overflowing */
#primary {
  min-width: 0;
  overflow: hidden;
}

/* ── Blog Post Cards ─────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .post-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.post-card-image {
  position: relative;
  overflow: hidden;
}
.post-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .4s;
}
.post-card:hover .post-card-image img { transform: scale(1.04); }

.post-card-category {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--green);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2rem .6rem;
  border-radius: 50px;
}

.post-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .6rem;
  color: var(--text);
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--green); }

.post-card-excerpt {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.post-card-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--green);
  color: var(--white) !important;
  font-size: .8rem;
  font-weight: 700;
  padding: .5rem 1rem;
  border-radius: var(--r-sm);
  align-self: flex-start;
  transition: background .2s;
}
.post-card-link:hover { background: var(--green-dark) !important; }
.post-card-link::after { content: '→'; }

/* ── Single Post ─────────────────────────────────────────── */
.single-post-header { margin-bottom: 1.5rem; }

.single-post-category {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2rem .75rem;
  border-radius: 50px;
  margin-bottom: .75rem;
}

.single-post-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .75rem;
}

.single-post-meta {
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.single-post-featured {
  margin-bottom: 2rem;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.single-post-featured img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.post-content p { margin-bottom: 1.25rem; }
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--green-light);
  color: var(--text);
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 .5rem;
  color: var(--green-dark);
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .4rem; }
.post-content blockquote {
  border-left: 4px solid var(--amber);
  background: var(--green-light);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--green-dark);
}
.post-content a { text-decoration: underline; }
.post-content img {
  border-radius: var(--r-md);
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}

/* ── Sidebar ─────────────────────────────────────────────── */
#ashridge-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 1024px) {
  #ashridge-sidebar {
    margin-top: 0;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--green);
}

/* Search widget */
.widget-search form {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.widget-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .5rem .875rem;
  font-size: .875rem;
  font-family: var(--font-body);
}
.widget-search button {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: .5rem .875rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Recent posts */
.widget-recent-posts li {
  border-bottom: 1px solid var(--border);
  padding: .6rem 0;
}
.widget-recent-posts li:last-child { border-bottom: none; }
.widget-recent-posts a {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.widget-recent-posts a:hover { color: var(--green); }
.widget-recent-posts .post-date {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .15rem;
}

/* Categories */
.widget-categories li {
  border-bottom: 1px solid var(--border);
  padding: .45rem 0;
  display: flex;
  justify-content: space-between;
}
.widget-categories li:last-child { border-bottom: none; }
.widget-categories a {
  font-size: .875rem;
  color: var(--muted);
}
.widget-categories a:hover { color: var(--green); }
.widget-categories .count {
  font-size: .75rem;
  background: var(--green-light);
  color: var(--green);
  padding: .1rem .45rem;
  border-radius: 50px;
  font-weight: 700;
}

/* Tags */
.widget-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.widget-tags a {
  background: var(--green-light);
  color: var(--green);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .25rem .65rem;
  border-radius: 50px;
  border: 1px solid rgba(58,92,46,.2);
  transition: all .2s;
}
.widget-tags a:hover {
  background: var(--green);
  color: var(--white);
}

/* Back to Ashridge CTA widget */
.widget-cta {
  background: var(--green);
  border-color: var(--green-dark);
  text-align: center;
  color: var(--white);
}
.widget-cta .widget-title {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,.3);
}
.widget-cta p {
  font-size: .875rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.widget-cta a.cta-btn {
  display: inline-block;
  background: var(--white);
  color: var(--green) !important;
  font-weight: 700;
  font-size: .85rem;
  padding: .6rem 1.25rem;
  border-radius: var(--r-sm);
  transition: background .2s;
}
.widget-cta a.cta-btn:hover { background: var(--green-light); }

/* ── Page Header (archive/category titles) ───────────────── */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}
.page-header p {
  font-size: .9rem;
  color: var(--muted);
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
  transition: all .2s;
}
.pagination a:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}
.pagination .current {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ── Footer ─────────────────────────────────────────────── */
#ashridge-footer {
  background: var(--maroon);
  color: rgba(255,255,255,.8);
  padding: 2.5rem 1rem 1rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand img { height: 44px; width: auto; margin-bottom: .75rem; filter: brightness(10); }
.footer-brand .text-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--white);
  font-weight: 700;
  margin-bottom: .5rem;
}
.footer-brand p {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.5);
  margin-bottom: .75rem;
}
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a {
  font-size: .875rem;
  color: rgba(255,255,255,.7);
  transition: color .2s;
}
.footer-col ul a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1rem;
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  text-align: center;
}
.footer-bottom a { color: rgba(255,255,255,.4); }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* ── Buttons (global) ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .875rem;
  padding: .65rem 1.4rem;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: var(--white) !important; }
.btn-primary:hover { background: var(--green-dark) !important; }
.btn-outline {
  background: transparent;
  color: var(--green) !important;
  border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green); color: var(--white) !important; }

/* ── WordPress block overrides ───────────────────────────── */
.wp-block-button__link {
  background: var(--green) !important;
  color: var(--white) !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  border-radius: var(--r-sm) !important;
  padding: .65rem 1.4rem !important;
}
.wp-block-button__link:hover { background: var(--green-dark) !important; }

.wp-block-quote {
  border-left: 4px solid var(--amber) !important;
  background: var(--green-light) !important;
  padding: 1rem 1.25rem !important;
  border-radius: 0 var(--r-md) var(--r-md) 0 !important;
}

.wp-block-table th {
  background: var(--green) !important;
  color: var(--white) !important;
}
.wp-block-table tr:nth-child(even) td {
  background: var(--green-light);
}

/* ── Utility ─────────────────────────────────────────────── */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.alignwide  { margin-left: -1.5rem; margin-right: -1.5rem; }
.alignfull  { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; }

/* ── Accessible focus ────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ── Contain rogue full-width images (e.g. category images from plugins) ── */
body img,
#ashridge-main img,
.post-content img,
.page-header img {
  max-width: 100% !important;
  height: auto !important;
}

.category-image, .term-image, .archive-header img,
.wpseo-category-image, .cat-image {
  max-width: 100% !important;
  max-height: 300px !important;
  object-fit: cover !important;
  border-radius: var(--r-lg) !important;
  margin-bottom: 1rem !important;
}

/* ── Sidebar: always constrained ─────────────────────────── */
#ashridge-sidebar {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
}
#ashridge-sidebar .widget {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 1023px) {
  #ashridge-sidebar { width: 100%; margin-top: 2rem; }
}

