/*
Theme Name: TGH Custom Theme
Theme URI: https://www.the-generous-husband.com/
Author: Paul H Byerly
Description: A lightweight, responsive custom theme
Version: 1.0.2
License: GNU General Public License v2 or later
Text Domain: tmb-custom-theme
*/

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

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7em;
  color: #666666;
  background-color: #ddc5a1; /* Matches custom background from source */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #2ea3f2;
  text-decoration: none;
  transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;
}

a:hover {
  opacity: 0.8;
}

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

.aligncenter {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================================
   2. Layout & Containers
   ========================================================================== */
#page-container {
  background-color: #ffffff;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

.container {
  width: 80%;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

#main-content {
  background-color: #ffffff;
  padding-top: 58px;
  padding-bottom: 40px;
}

/* Two-Column Setup */
@media (min-width: 981px) {
  #main-content .container::before {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e2e2e2;
    right: 20.875%;
  }

  #left-area {
    float: left;
    width: 73.625%;
    padding-right: 5.5%;
    padding-bottom: 23px;
  }

  #sidebar {
    float: right;
    width: 20.875%;
    padding-left: 30px;
    padding-bottom: 28px;
  }
}

/* ==========================================================================
   3. Article & Blog Posts
   ========================================================================== */
article.et_pb_post {
  margin-bottom: 60px;
  word-wrap: break-word;
}

h1.entry-title,
h2.entry-title {
  color: #333333;
  line-height: 1.3em;
  font-weight: 500;
  padding-bottom: 8px;
}

h1.entry-title { font-size: 28px; }
h2.entry-title { font-size: 26px; }

h2.entry-title a {
  color: #333333;
}

h2.entry-title a:hover {
  color: #2ea3f2;
}

.post-meta {
  font-size: 14px;
  color: #666666;
  margin-bottom: 15px;
}

.post-meta a {
  color: #666666;
}

.entry-featured-image-url {
  margin-bottom: 25px;
}

.entry-content p {
  padding-bottom: 1em;
  line-height: 1.7em;
  text-align: justify;
}

.entry-content strong {
  font-weight: 700;
}

.entry-content blockquote {
  margin: 20px 0 30px;
  border-left: 5px solid #2ea3f2;
  padding-left: 20px;
  font-style: italic;
}

.entry-content ul {
  list-style-type: disc;
  padding: 0 0 20px 1.5em;
  line-height: 1.7em;
}

.entry-content ol {
  list-style-type: decimal;
  padding: 0 0 20px 1.5em;
  line-height: 1.7em;
}

/* ==========================================================================
   4. Pagination & Post Navigation
   ========================================================================== */
.pagination {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e2e2;
}

.nav-single a,
.pagination a {
  color: #2ea3f2;
  font-size: 14px;
  font-weight: 600;
}

/* Single Post Navigation */
.nav-single {
  clear: both;
  width: 100%;
}

.nav-single .nav-previous {
  float: left;
  width: 48%;
  text-align: left;
}

.nav-single .nav-next {
  float: right;
  width: 48%;
  text-align: right;
}

/* ==========================================================================
   5. Sidebar & Widgets
   ========================================================================== */
.et_pb_widget {
  margin-bottom: 30px;
  word-wrap: break-word;
}

.widgettitle {
  color: #333333;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-bottom: 2px solid #f2f2f2;
}

.et_pb_widget ul {
  list-style: none;
}

.et_pb_widget li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f7f7f2;
}

.et_pb_widget a {
  color: #666666;
}

.et_pb_widget a:hover {
  color: #2ea3f2;
}

/* Search Form Widget */
.widget_search input[type="text"],
.widget_search input[type="search"] {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 8px;
}

.widget_search input[type="submit"] {
  background-color: #32373c;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
}

.widget_search input[type="submit"]:hover {
  background-color: #2ea3f2;
}

/* ==========================================================================
   6. Responsive Design
   ========================================================================== */
@media (max-width: 980px) {
  #page-container {
    width: 100%;
  }

  .container {
    width: 90%;
  }

  #left-area,
  #sidebar {
    width: 100% !important;
    float: none !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  #main-content .container::before {
    display: none !important;
  }

  article.et_pb_post {
    margin-bottom: 40px;
  }

  h1.entry-title { font-size: 22px; }
  h2.entry-title { font-size: 20px; }
}

@media (max-width: 479px) {
  #main-content {
    padding-top: 30px;
  }

  .entry-content p {
    text-align: left; /* Better readability on small mobile screens */
  }
}

/* --- Single Post Navigation (Forced Single-Line Layout) --- */
.post-navigation {
    margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    clear: both;
    width: 100% !important;
    box-sizing: border-box;
}

.post-navigation .nav-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.post-navigation .nav-previous {
    text-align: left !important;
    flex: 1 1 50% !important;
}

.post-navigation .nav-next {
    text-align: right !important;
    flex: 1 1 50% !important;
}

.post-navigation a {
    color: #7c5874;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.post-navigation a:hover,
.post-navigation a:focus {
    color: #2d7cda;
    text-decoration: underline;
}

/* --- OVERRIDE TOP MAIN BANNER SIZE --- */
F.banner {
    width: 100% !important;
    text-align: center !important;
}

.banner a {
    display: block !important;
    width: 100% !important;
}

.banner a img {
    /* 1. CONTROL WIDTH: Set how wide the banner can stretch (e.g., 900px, 1100px, or 100%) */
    max-width: 900px !important; 

    /* 2. CONTROL HEIGHT: Cap how tall the banner can be (e.g., 180px, 220px, etc.) */
    max-height: 20px !important; 

    width: 100% !important;
    height: auto !important;
    object-fit: cover !important; /* Prevents distortion if you restrict height */
    margin: 0 auto !important;
    display: block !important;
}

/* Mobile Screen Scaling */
@media screen and (max-width: 768px) {
    .banner a img {
        max-width: 100% !important;
        max-height: 140px !important;
    }
}