/*
 * MERIDIO THEME STYLESHEET
 * Option F (refined) – Two-column editorial + inline subscribe band
 * Sections:
 * 1. Design Tokens
 * 2. Base / Reset
 * 3. Layout Wrapper
 * 4. Utilities / Animations
 * 5. Hero (Slide 1)
 * 6. Editorial (Slide 2)
 * 7. Subscribe Band
 * 8. Post Template
 * 9. Responsive
 * 10. Koenig Placeholders
 */

/*------------------------------------*
  1. Design Tokens
*------------------------------------*/
:root {
  --brand-color: #b17457;
  --accent-color: #d8d2c2;
  --text-color: #322d23;
  --background-color: #f9f7f0;

  --gh-font-heading: "loretta", serif;
  --gh-font-body: "Fira Sans", sans-serif;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
  --spacing-xl: 6rem;

  --transition-fast: 0.18s ease;
  --watermark-size: 1800px;
  --watermark-opacity: 0.025;
}

/*------------------------------------*
  2. Base / Reset
*------------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--gh-font-body);
  color: var(--text-color);
  background: var(--background-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
}

html {
  scroll-behavior: smooth;
}

/*------------------------------------*
  3. Layout Wrapper
*------------------------------------*/
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(2rem, 6vw, 5rem);
}

/*------------------------------------*
  4. Utilities / Animations
*------------------------------------*/
.anchor-offset {
  position: relative;
  top: -2rem;
  visibility: hidden;
}

@keyframes scrollBounce {
  0%,
  60%,
  100% {
    transform: translate(-50%, 0) rotate(-45deg);
  }
  30% {
    transform: translate(-50%, 8px) rotate(-45deg);
  }
}

/*------------------------------------*
  5. Hero (Slide 1)
*------------------------------------*/
#slide1 {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding-top: clamp(4rem, 12vh, 7rem);
  padding-bottom: clamp(2rem, 6vh, 4rem);
}
#slide1 .logo {
  width: 100%;
  max-width: clamp(160px, 22vw, 300px);
  margin-bottom: 1rem;
}
#slide1 h1 {
  font-family: var(--gh-font-heading);
  font-size: clamp(0.95rem, 0.7vw + 0.9rem, 1.25rem);
  font-weight: 400;
  line-height: 1.2;
  max-width: 640px;
  margin: 0 0 1.25rem;
  color: var(--text-color);
}
#slide1 .coming-soon {
  font-size: 1rem;
  margin: 0;
  color: var(--brand-color);
}

.cta-primary {
  margin-top: 1.75rem;
  background: var(--brand-color);
  color: var(--background-color);
  font: inherit;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.1;
  letter-spacing: 0.5px;
  transition: filter var(--transition-fast), box-shadow var(--transition-fast);
}
.cta-primary:hover {
  filter: brightness(0.92);
}
.cta-primary:focus {
  outline: none;
  box-shadow: 0 0 0 2px #e9d6cc;
}

.scroll-hint {
  background: transparent;
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 44px;
  margin-top: 3rem;
  position: relative;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.scroll-hint:focus {
  outline: none;
}

.scroll-hint:hover {
  opacity: 0.9;
}

.scroll-hint span {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-left: 2.25px solid var(--text-color);
  border-bottom: 2.25px solid var(--text-color);
  transform: rotate(-45deg);
  animation: scrollBounce 1.8s infinite ease-in-out;
}

/*------------------------------------*
  6. Editorial (Slide 2 – heading + two columns + watermark)
*------------------------------------*/
#slide2 {
  position: relative;
  padding-top: clamp(2.5rem, 7vh, 4.5rem);
  padding-bottom: clamp(5rem, 11vh, 8rem);
  text-align: left;
  overflow: visible; /* changed from hidden to prevent clipping */
}
#slide2::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/images/M.png") center/var(--watermark-size)
    var(--watermark-size) no-repeat;
  background-size: var(--watermark-size) var(--watermark-size);
  opacity: var(--watermark-opacity);
  filter: grayscale(100%);
  pointer-events: none;
  transform: translateY(5%);
}

#slide2 .two-col-wrapper {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(2.5rem, 5vw, 5rem);
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
  position: relative;
}

#slide2 .section-title {
  grid-column: 1 / -1;
  font-family: var(--gh-font-heading);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 400;
  color: var(--brand-color);
  margin: 0 0 2.25rem;
}

#slide2 .cols {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(2.5rem, 5vw, 5rem);
}

#slide2 .col {
  max-width: 52ch;
}
#slide2 .col-left {
  grid-column: 1 / span 6;
}
#slide2 .col-right {
  grid-column: 7 / -1;
}

#slide2 p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1.1rem;
  overflow-wrap: anywhere; /* added to avoid edge clipping on narrow devices */
}
#slide2 .col-left p,
#slide2 .col-right p {
  text-align: justify;
  text-justify: inter-word;
}
#slide2 p.closing-line {
  margin-top: 1.25rem;
  margin-bottom: 0;
  text-align: left;
}

/*------------------------------------*
  7. Subscribe Band (inline call to action)
*------------------------------------*/
.subscribe-band {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 820px;
  margin: 4rem auto 0;
  padding: 0 0 2.25rem;
  background: none;
  border: none;
  border-radius: 0;
  text-align: center;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.subscribe-band .subscribe-card-heading {
  font-family: var(--gh-font-heading);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--brand-color);
  margin: 0 0 0.85rem;
}
.subscribe-band .subscribe-card-lead {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.subscribe-band .subscribe-form {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: stretch;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}
.subscribe-band .subscribe-input {
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #c89273;
  border-radius: 6px;
  background: #fff;
  color: var(--text-color);
}
.subscribe-band .subscribe-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #e9d6cc;
}
.subscribe-band .subscribe-button {
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 6px;
  background: var(--brand-color);
  color: var(--background-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: filter var(--transition-fast);
}
.subscribe-band .subscribe-button:hover {
  filter: brightness(0.92);
}
.subscribe-band .subscribe-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px #e9d6cc;
}

.subscribe-band .loading,
.subscribe-band .error,
.subscribe-band .success {
  display: none;
  font-size: 0.7rem;
  margin-top: 0.55rem;
}
.custom-subscribe.loading .loading,
.custom-subscribe.error .error,
.custom-subscribe.success .success {
  display: block;
}
.custom-subscribe.success .subscribe-input,
.custom-subscribe.success .subscribe-button {
  opacity: 0.45;
  pointer-events: none;
}

/*------------------------------------*
  8. Post Template
*------------------------------------*/
.post-article {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}
.post-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}
.post-title {
  font-family: var(--gh-font-heading);
  font-size: 2.5rem;
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
}
.post-feature-image {
  width: 100%;
  height: auto;
  margin: var(--spacing-sm) 0;
}
.post-content {
  font-size: 1.1rem;
  line-height: 1.6;
}

/*------------------------------------*
  9. Responsive
*------------------------------------*/
@media (max-width: 960px) {
  .page-wrapper {
    padding-inline: var(--spacing-sm);
  }

  html,
  body {
    -webkit-text-size-adjust: 100%;
  }

  #slide2 {
    overflow: visible;
  }

  #slide2::before {
    background-size: 340px 340px;
    transform: translateY(0);
  }

  /* Collapse BOTH grids to single column */
  #slide2 .two-col-wrapper {
    display: grid !important;
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 1.6rem;
    overflow: visible !important;
  }

  #slide2 .cols {
    display: grid;
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 1.6rem;
  }

  #slide2 .col,
  #slide2 .col-left,
  #slide2 .col-right {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
  }

  #slide2 .col-left p,
  #slide2 .col-right p {
    text-align: justify;
    text-justify: inter-word;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .subscribe-band {
    margin-top: 2.5rem;
    max-width: 100%;
  }
  .subscribe-band .subscribe-form {
    flex-direction: column;
    max-width: 100%;
  }
  .subscribe-band .subscribe-input,
  .subscribe-band .subscribe-button {
    width: 100%;
  }

  h1,
  .post-title {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
  }

  #slide1 .logo {
    max-width: 250px;
    margin-bottom: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .post-article {
    padding: var(--spacing-sm);
  }
}

/*------------------------------------*
  10. Koenig Placeholders
*------------------------------------*/
.kg-gallery-container {
}
.kg-gallery-row {
}
.kg-gallery-image {
}
.kg-bookmark-card {
}
.kg-bookmark-container {
}
.kg-bookmark-content {
}
.kg-bookmark-title {
}
.kg-bookmark-description {
}
.kg-bookmark-metadata {
}
.kg-bookmark-icon {
}
.kg-bookmark-author {
}
.kg-bookmark-publisher {
}
.kg-bookmark-thumbnail {
}
.kg-callout-card {
}
.kg-callout-emoji {
}
.kg-callout-text {
}
.kg-callout-card-background-grey {
}
.kg-callout-card-background-white {
}

/*------------------------------------*
  Koenig Core / Width Utilities
*------------------------------------*/

/* Base card reset */
.kg-card {
  margin: 2rem 0;
}
.kg-card:first-child {
  margin-top: 0;
}
.kg-card:last-child {
  margin-bottom: 0;
}

.kg-card figcaption {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6f665a;
  text-align: center;
  margin-top: 0.6rem;
  letter-spacing: 0.2px;
}

/* Image / media defaults */
.kg-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Optional nicer handling for galleries */
.kg-gallery-container {
  margin: 2rem 0;
}
.kg-gallery-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Width Vars */
:root {
  --content-max: 1200px;
  --wide-max: 1400px;
}

/* Constrain normal cards inside your wrapper naturally */
.post-article .kg-card,
.page-wrapper .kg-card {
  max-width: 100%;
}

/* Wide: break out slightly */
.kg-width-wide {
  position: relative;
  width: 100%;
  max-width: var(--wide-max);
  margin: 2.5rem auto;
}

/* Full: true viewport bleed */
.kg-width-full {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin: 2.5rem 50%;
  transform: translateX(-50%);
}

/* Make images obey full area */
.kg-width-wide .kg-image,
.kg-width-full .kg-image,
.kg-width-wide iframe,
.kg-width-full iframe,
.kg-width-wide video,
.kg-width-full video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Remove radius on true full bleed */
.kg-width-full .kg-image {
  border-radius: 0;
}

/* Responsive breakouts flatten */
@media (max-width: 960px) {
  .kg-width-wide,
  .kg-width-full {
    width: 100%;
    max-width: 100%;
    margin: 2rem 0;
    transform: none;
  }
  .kg-width-full .kg-image {
    border-radius: 6px;
  }
}

/* End */
html,
body {
  overflow-x: hidden;
} /* safety */

html,
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); /* for iOS Safari */
}

.page-wrapper {
  flex: 1;
}

.end-bar {
  flex-shrink: 0;
  width: 100%;
  height: 20px;
  background: var(--brand-color);
  margin-top: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
