/* =========================
         Variables
   ========================= */

:root {
    --page-background-color: #f7f6f3;
    --card-background-color: #ffffff;
    --main-text-color: #2f2f2f;
    --link-color: #4d270a;
    --link-visited-color: #513195;
    --link-active-color: rgb(147, 99, 55);
    --my-border: 2px solid rgb(230, 224, 224);
}

/* =========================
      RESET / BASE STYLES
   ========================= */

*,
::before,
::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", Geneva, Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background-color: var(--page-background-color);
  color: var(--main-text-color);
  scroll-behavior: smooth;
}

/* LINKS */

a {
  text-decoration: none;
}

main a {
  border-bottom: 1px dotted var(--main-text-color);
  color: var(--link-color);
}

a:active {
  color: var(--link-active-color);
}

a:visited {
  color: var(--link-visited-color);
}

/* IMG */

img {
  display: block;
}


/* =========================
       TYPOGRAPHY
   ========================= */

header, footer, h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', Times, serif;
}

h1 {
  font-size: 1.7rem;
  font-weight: 200;
  line-height: 1.3;
  margin-bottom: 15px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 150;
  margin-bottom: 15px;
}

h3 {
  font-size: 1.3rem;
  font-weight: 100;
  margin-bottom: 15px;
}

h4 {
  font-size: 1.2rem;
  font-weight: 100;
  margin-bottom: 15px;
}

p {
  margin-bottom: 15px;
}

ul, ol {
  padding-left: 30px;
  margin-bottom: 15px;
}

.bold {
  font-weight: bold;
}

/* =========================
        COMPONENTS
   ========================= */

.my-btn {
  border: var(--my-border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--main-text-color);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.small-btn {
  padding: 5px 10px;
  font-size: 14px;
}

.big-btn {
  padding: 15px;
  font-size: 16px;
}

.dark-btn {
  background-color: var(--page-background-color);
}

.dark-btn:hover {
  background-color: var(--card-background-color);
  transform: scale(1.01);
}

.light-btn {
  background-color: var(--card-background-color);
}

.light-btn:hover {
  background-color: var(--page-background-color);
  transform: scale(1.01);
}

/* =========================
     LAYOUT (MOBILE FIRST)
   ========================= */

main > :not(.hero) {
  width: 90%;
  margin-inline: auto;
}

#header {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#header.separation-line {
  border-bottom: var(--my-border);
}

.site-title {
  font-family: "Italiana", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 2.6rem;
  text-shadow: 1px 1px 10px #c1bdbd;
  text-align: center;
  margin-bottom: 15px;
}

.site-title a,
.site-title a:visited {
  color: var(--main-text-color);
}

.nav-head ul {
  list-style: none;
  padding: 0;
}

.nav-head li{
  display: inline;
  text-align: center;
  font-size: 1.2rem;
  padding-inline: 30px;
}

.nav-head a {
  color: var(--main-text-color);
}

.hero {
  height: 400px;
  overflow: hidden;
  position: relative;
}

.hero-img {
  width: 100%;   /* Image takes the full width of the container */
  height: 100%;  /* Image takes the full height of the container */
  object-fit: cover; /* Scales and crops the image to fill the container */
  object-position: center; /* Centers the focal point of the image (default) */
}

.hero-text {
  width: 100%;
  position: absolute;
  top: 50%;
  transform: translate(0, -50%); /* Offsets the element by half its own size */
  background: rgba(255, 255, 255, 0.45);
  padding: 1rem;
  backdrop-filter: blur(2px);
  text-align: center;
}

/*****  Home Page ** Blog Page *****/

.start-content {
  text-align: center;
  border-bottom: var(--my-border);
  padding: 20px 0;
  margin-top: 30px;
}

#featured-posts,
#blog-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.carousel-wrapper {
  position: relative; /* Anchor point for buttons */
}

#btn-next, #btn-prev {
  position: absolute;
  top: 50%;
  transform: translateY(-50%); /* Perfectly centers vertically */
  z-index: 10; /* Ensure buttons are on top */
  color: white;
  background-color: rgba(0, 0, 0, 0.35); /* Semi-transparent background */
  border: none;
  padding: 20px 10px;
  cursor: pointer;
}

#btn-prev {
  left: 10px;
}

#btn-next {
  right: 10px;
}

#seasonal-posts {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding-bottom: 10px;
  scrollbar-width: none; /* Firefox */
}

#seasonal-posts::-webkit-scrollbar /* Chrome, Safari and Opera */ {
    display: none;
}

#seasonal-posts .blog-preview {
  min-width: 100%;
}

#carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: var(--my-border);
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background-color: rgb(230, 224, 224);
}

.carousel-dot:hover {
  transform: scale(1.3);
}

.blog-preview {
  scroll-snap-align: center;
  color: var(--main-text-color);
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* This makes the card body take up all available vertical space */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--card-background-color);
  border: var(--my-border);
  border-radius: 10px;
  padding: 15px;
}

.blog-preview:visited {
  color: var(--main-text-color);
}

.blog-preview:active {
  transform: scale(0.98);
  box-shadow:  0 0 10px rgb(4, 4, 4);
}

.bp-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.bp-description h3 {
  padding: 5px 0;
  border-bottom: var(--my-border);
}

.bp-description p {
  margin-bottom: 5px;
}

.read-more {
  font-size: 0.9em;
  border-bottom: 1px dotted var(--main-text-color);
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 20px;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.page-info {
  font-size: 0.8rem;
}

/************ About ************/

.main-about {
  margin-top: 20px;
}

/************ Blog Post - articles ************/

.article-img {
  margin-top: 20px;
  width: 100%;
  height: auto;
  object-fit: cover;
}

article h1 {
  margin-top: 20px;
}

.post-date {
  font-size: 0.8rem;
  font-style: italic;
}

.affiliate-disclosure {
  font-size: 0.85em;
}

.house-plant-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.house-plant-img {
  max-width: 300px;
  height: auto;
  margin-bottom: 20px;
}

.small-article-body-img {
  width: 400px;
  height: auto;
  margin-bottom: 20px;
  margin-inline: auto;
}

.article-body-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin-top: 20px;
  margin-bottom: 20px;
}

.article-body-img.full-img {
  height: auto;
}

.article-table {
  text-align: left;
  border: var(--my-border);
  border-radius: 5px;
  background-color: #ffffff;
  padding: 10px;
  font-size: 0.8em;
  margin: 20px auto;
}

.article-table th,
.article-table td {
  padding: 10px;
}

#affiliate-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 20px;
}

.accordion-item {
  border: var(--my-border);
  border-radius: 5px;
  overflow: hidden;
}

.accordion-button {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-button::after {
  content: "▸";
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-button.open::after {
  transform: rotate(90deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  background-color: var(--card-background-color);
}

.accordion-content.open {
  max-height: 800px;
  opacity: 1;
  padding: 15px;
}

/************* You might also like *************/

.related-posts-section {
  border-top: var(--my-border);
  margin-top: 30px;
  padding: 30px 0;
}

.rp-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 0;
  border-bottom: var(--my-border);
  text-decoration: none;
  color: var(--main-text-color);
}

.rp-link:last-child {
  border-bottom: none;
}

.rp-link img {
  width: 100px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
}

.rp-link:hover {
  transform: translateX(4px);
  transition: 0.2s ease;
}

/************ Footer ************/


#footer {
  border-top: var(--my-border);
  margin-top: 80px;
}

.nav-footer {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 10px;;
  margin-bottom: 40px;
  background-color: var(--card-background-color);
  border-bottom: var(--my-border);
}

.nav-footer ul {
  list-style: none;
  padding: 0;
}

.nav-footer li{
  display: inline;
  padding: 0 15px;
}

.nav-footer a {
  color: var(--main-text-color);
}

.nav-footer > a:hover{
  border-bottom: 1px dotted var(--main-text-color);
  color: var(--link-active-color);
  cursor: pointer;
}

.icon {
  padding: 0 20px;
  border-bottom: none;
}

.footer-text {
  text-align: center;
}

/* =========================
        MEDIA QUERIES
   Mobile → Tablet → Laptop
   ========================= */

/* Medium devices (landscape tablets, 768px and up) */
@media (min-width: 768px) {

main > :not(.hero) {
  width: 95%;
  margin-inline: auto;
}

#header {
  flex-direction: row;
  justify-content: space-around;
  align-items: center; /* Vertically centers items */
}

.site-title {
  padding-left: 2rem;
  margin-bottom: 0;
}

.nav-head ul {
  margin-bottom: 0;
}

/*****  Home Page ** Blog Page *****/

#featured-posts,
#blog-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

#seasonal-posts .blog-preview {
  min-width: calc((100% - 20px) / 2); /* card - gap split between 2 cards */
}

/************ About ************/

/************ Blog Post - articles ************/

.article-img {
  margin-top: 0;
  max-width: 250px;
  height: auto;
  float: left;
  margin-right: 20px;
}

.house-plant-box {
  flex-direction: row;
  align-items: flex-start;
  margin-bottom: 20px;
}

.house-plant-description {
  margin-left: 20px;
  padding-left: 20px;
  border-left: var(--my-border);
}

.house-plant-description > :last-child,
.article-intro > :last-child  {
  margin: 0;
}

.small-article-body-img {
  float: left;
  margin-right: 20px;
  margin-bottom: 0;
}
.article-body-img {
  height: auto;
}

.plant-table {
  width: 100%;
  padding: 20px;
  font-size: 1em;
}

/************* You might also like *************/

/************ Footer ************/

.nav-footer {
  display: flex;
  justify-content: space-evenly;
}

.nav-footer li{
  padding: 0 20px;
}

}


/*******************************************************

      LARGE DEVICES (laptops/desktops, 992px and up)

*********************************************************/

@media (min-width: 992px) {

main > :not(.hero) {
  width: min(95%, 1300px);
  margin-inline: auto;
}

.site-title {
  letter-spacing: 0.12em;
}

.nav-head ul {
  margin-right: 3rem;
}

.nav-head li{
  padding-inline: 50px;
}

.hero {
  height: 500px;
}

.hero-text {
  max-width: 550px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Offsets the element by half its own size */
  padding-inline: 2rem;
  border-radius: 10px;
}

/*****  Home Page ** Blog Page *****/

#featured-posts {
  margin-top: 40px;
  grid-template-columns: repeat(4, 1fr);
}

.carousel-wrapper {
  margin-top: 40px;
}

#seasonal-posts .blog-preview {
  min-width: calc((100% - 40px) / 3); /* width - 2 gaps split between 3 cards */
}

#blog-list {
  grid-template-columns: repeat(3, 1fr);
}

.blog-preview:hover {
  transform: scale(0.98);
  box-shadow:  0 0 10px rgb(4, 4, 4);
}

/************ About ************/

.main-about {
  max-width: 900px;
  text-align: justify;
}

/************ Blog Post - articles ************/

main > article {
  max-width: 900px;
  text-align: justify;
}

.article-img {
  max-width: 300px;
}

/************* You might also like *************/

/************ Footer ************/

}
