/* =========================================
   1. GLOBAL RESET & BASE
   ========================================= */
* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  padding: 0;
  font-family: Helvetica, sans-serif;
  background-image: url('sunny-trees.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: #000;
}

/* =========================================
   2. TEXT & TYPOGRAPHY
   ========================================= */
.site-title {
  font-family: Bradley Hand;
  font-size: clamp(2rem, 6vw, 5rem);
  color: #fff;
}

h1, h2, h3, h4, h5 { font-family: Bradley Hand; line-height: 1.2; margin: 0.25em 0; }
h1 { font-size: clamp(2.5rem, 4vw, 4rem); }
h2 { font-size: clamp(2rem, 3.5vw, 3.5rem); }
h3 { font-size: clamp(1.8rem, 2.8vw, 3rem); }
h4 { font-size: clamp(1.1rem, 2.2vw, 1.6rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }

p { margin: 0 0 0.75em; }

.status-draft { color: #c00; font-weight: bold; }
.status-published { color: #080; }

/* =========================================
   3. LAYOUT & GRID SYSTEM
   ========================================= */
.wrapper { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.topbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 1.125rem;
  margin-bottom: 1.125rem;
}

/* Base Box Styling */
.box, .box-left, .box-right {
  background: #fff;
  border: 0.125rem solid #000;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.box { padding: 0.5rem 1rem 0.75rem; }
.content {
    overflow: visible;
}
/* Desktop Grids */
.columns { display: grid; grid-template-columns: 3fr 1fr; gap: 1.125rem; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }
.boxes-top { display: grid; grid-template-columns: 1fr 2fr; gap: 1.125rem; }

.scrollable { max-height: 12.5rem; overflow-y: auto; }

/* =========================================
   4. LINKS & NAVIGATION
   ========================================= */
a { color: #00D100; text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }

.menu-box {
  grid-column: 3/4;
  justify-self: end;
  background: #fff;
  border: 0.125rem solid #000;
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  white-space: nowrap;
}

.btn {
  background: #FF0000; color: #fff; border: none;
  padding: 0.5rem 0.875rem; border-radius: 0.375rem;
  display: inline-block;
}

/* Tags */
.tags a.tag { color: #00D100; margin-right: 0.4em; }
.tag-size-small { font-size: 0.85rem; }
.tag-size-medium { font-size: 1rem; font-weight: 600; }
.tag-size-large { font-size: 1.25rem; font-weight: bold; }

/* =========================================
   5. IMAGES & MEDIA
   ========================================= */
img {
  max-width: 100% !important;
  height: auto !important;
}

.thumb { width: 100%; overflow: hidden; margin-bottom: 0.5rem; }

.thumb img { width: 100% !important; object-fit: cover; }

.post-img{
    display:block;
    max-width:50%;
    height:auto;
    margin:1rem auto;
}

.post-img.alignleft{
    float:left;
    margin:0 20px 15px 0;
}

.post-img.alignright{
    float:right;
    margin:0 0 15px 20px;
}

.preview-img { max-width: 25px; }

/* Alternator Image logic */
.alt-image {
  position: relative;
  width: 100%;
  padding-top: 43.94%; /* Aspect Ratio */
  overflow: hidden;
}

.alt-image img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; opacity: 0; filter: blur(2px);
  transition: opacity 1.5s ease-in-out, filter 1s ease-in-out;
}
.alt-image img.active { opacity: 1; filter: blur(0); z-index: 2; }


/* =========================================
   6. MOBILE OVERRIDES (Combined & Cleaned)
   ========================================= */
@media (max-width: 600px) {
  html { font-size: 14px; }

  .topbar { grid-template-columns: 1fr auto; gap: 0.5rem; }
  .site-title { font-size: clamp(1.5rem, 10vw, 2.5rem); grid-column: 1 / 2; }
  .menu-box { grid-column: 2 / 3; padding: 0.4rem 0.6rem; }

  /* Stack all grids to 1 column */
  .grid-3, .columns, .boxes-top { grid-template-columns: 1fr; }
  .grid-3 > div { min-width: 0; }

  /* Fix the Gaps */
  .thumb, .box, .box-left { 
    padding-bottom: 0.25rem !important; 
    margin-bottom: 0.75rem !important; 
  }

  /* Target headings immediately following an image container */
  .thumb + h1, .thumb + h2, .thumb + h3, .thumb + h4,
  div + h1, div + h2, div + h3 { 
    margin-top: 0 !important; 
  }

  /* Fix the Alternator gap on mobile */
  .alt-image { padding-top: 56.25% !important; } /* 16:9 ratio is safer for mobile */
}
