/* Luis Mendo Ghost Theme */

/* -----------------------------------------------
   Reset & Base
   ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: "Mendo Titles Bold";
  src: url("../webfonts/MendoTitles-Bold.otf") format("opentype"),
       url("../webfonts/MendoTitles-Bold.woff2") format("woff2");
  unicode-range: U+000D, U+0020-007E, U+00A0-00A3, U+00A5-00FF, U+0131,
    U+0141-0142, U+0152-0153, U+0160-0161, U+0178, U+017D-017E, U+0192,
    U+02C6-02C7, U+02D8-02DD, U+03C0, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC,
    U+2122, U+2126, U+2202, U+2206, U+220F, U+2211-2212, U+221A, U+221E,
    U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+F8FF, U+FB01-FB02;
}

@font-face {
  font-family: "Mendo Titles Light";
  src: url("../webfonts/MendoTitles-Light.woff2") format("woff2");
  unicode-range: U+000D, U+0020-007E, U+00A0-00A3, U+00A5-00FF, U+0131,
    U+0141-0142, U+0152-0153, U+0160-0161, U+0178, U+017D-017E, U+0192,
    U+02C6-02C7, U+02D8-02DD, U+03A9, U+03C0, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC,
    U+2122, U+2202, U+2206, U+220F, U+2211-2212, U+221A, U+221E, U+222B,
    U+2248, U+2260, U+2264-2265, U+25CA, U+F8FF, U+FB01-FB02;
}

@font-face {
  font-family: "Mendo Sans";
  src: url("../webfonts/MendoSans-Regular.otf") format("opentype");
}

@font-face {
  font-family: "Friend Regular";
  src: url("../webfonts/Friend-Regular.woff2") format("woff2");
  unicode-range: U+000D, U+0020-007E, U+00A1-00AC, U+00AE-00B1, U+00B4,
    U+00B6-00B8, U+00BA-0148, U+014A-017E, U+018F, U+0192, U+019D,
    U+01A0-01A1, U+01FA-01FB, U+0218-021B, U+0237, U+0259, U+0272,
    U+02C6-02C7, U+02D8-02DD, U+0326, U+03BC, U+1E80-1E85, U+1E9E,
    U+1EA0-1EF9, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022,
    U+2026, U+2030, U+2039-203A, U+20AC, U+2122, U+2153-2154, U+2212,
    U+221E, U+2248, U+2260, U+2264-2265, U+FB00-FB04;
}

:root {
  --bg: #f3f3ee;
  --text: #6d6961;
  --accent: #f37070;
  --btn: #EF9EA3;
  --font: 'Friend Regular', Georgia, serif;
  --font-sans: 'Mendo Sans', ui-sans, sans-serif;
  --font-titles-bold: 'Mendo Titles Bold', ui-sans, sans-serif;
  --font-titles-light: 'Mendo Titles Light', ui-sans, sans-serif;
  --font-friend: 'Friend Regular', Georgia, serif;
  --gh-font-heading: 'Mendo Titles Bold', ui-sans, sans-serif;
  --gh-font-body: 'Friend Regular', Georgia, serif;
}

body.lm-body {
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }
.lm-gallery-img { max-width: none; }

/* -----------------------------------------------
   Desktop Sidebar
   ----------------------------------------------- */
.lm-sidebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  height: 100vh;
  padding-left: 55px;
  padding-right: 14px;
}

/* Homepage: sidebar adapts colors to the gallery image behind it */
.home-template .lm-sidebar {
  height: auto;
  background: var(--nav-bg, #ffffff);
  padding-left: 25px;
  padding-right: 25px;
  padding-bottom: 20px;
  margin-left: 20px;
  margin-top: 20px;
  transition: background 0.6s ease;
}

.home-template .lm-nav-link {
  color: var(--nav-text, var(--text));
  transition: color 0.6s ease;
}

.home-template .lm-nav-link:hover {
  color: var(--nav-accent, var(--accent));
}

.home-template .lm-copyright {
  color: var(--nav-copy, var(--text));
  transition: color 0.6s ease;
}

.home-template .lm-sidebar-logo {
  position: relative;
}

.home-template .lm-sidebar-logo .lm-logo-img {
  visibility: hidden;
}

.home-template .lm-sidebar-logo a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--nav-text, var(--text));
  -webkit-mask: url("/assets/images/logo.png") no-repeat left center / contain;
  mask: url("/assets/images/logo.png") no-repeat left center / contain;
  transition: background-color 0.6s ease;
}

.lm-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
  width: 200px;
}

.home-template .lm-sidebar-inner {
  height: auto;
  justify-content: flex-start;
}

.lm-sidebar-scroll {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.home-template .lm-sidebar-scroll {
  height: auto;
}

.lm-sidebar-logo {
  margin: 20px 20px 32px 0;
}

.lm-logo-img {
  height: 68px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.lm-sidebar-content {
  flex: 1;
  overflow: auto;
}

.lm-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lm-nav-link {
  font-family: var(--font-titles-bold);
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.25;
  padding: 4px 8px;
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.lm-nav-link:hover,
.lm-nav-link.is-active {
  color: var(--accent);
}

.lm-copyright {
  padding: 16px 0 10px;
  text-align: left;
  color: var(--text);
  font-family: var(--font-titles-light);
  font-weight: 400;
  font-size: 10px;
}

/* -----------------------------------------------
   Mobile Header
   ----------------------------------------------- */
.lm-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg);
}

.home-template .lm-mobile-header {
  background: var(--nav-bg, var(--bg));
  transition: background 0.6s ease;
}

.home-template .lm-mobile-nav-link {
  color: var(--nav-text, var(--text));
  transition: color 0.6s ease;
}

.home-template .lm-mobile-nav-link:hover {
  color: var(--nav-accent, var(--accent));
}

.home-template .lm-mobile-copyright {
  color: var(--nav-copy, var(--text));
  transition: color 0.6s ease;
}

.home-template .lm-mobile-logo-link {
  position: relative;
}

.home-template .lm-mobile-header .lm-mobile-logo-img {
  visibility: hidden;
}

.home-template .lm-mobile-logo-link::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  background-color: var(--nav-text, var(--text));
  -webkit-mask: url("/assets/images/logo.png") no-repeat left center / contain;
  mask: url("/assets/images/logo.png") no-repeat left center / contain;
  transition: background-color 0.6s ease;
}

.home-template .lm-bar {
  background: var(--nav-text, var(--text));
  transition: background 0.6s ease;
}

.lm-mobile-header-bar {
  display: flex;
  align-items: center;
  position: relative;
}

.lm-mobile-logo-wrap {
  display: flex;
  margin: 0;
  margin-right: 70px;
}

.lm-mobile-logo-link {
  display: inline-block;
  padding: 20px;
  text-decoration: none;
}

.lm-mobile-logo-img {
  display: block;
  max-height: 60px;
  height: 57px;
  width: auto;
}

.lm-hamburger {
  position: absolute;
  top: 50%;
  right: 20px;
  margin-top: -12px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  outline: none;
  z-index: 11;
}

.lm-hamburger-lines {
  width: 25px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lm-bar {
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: all 0.15s;
}

.lm-hamburger.is-open .bar1 {
  transform: rotate(45deg) translateY(8px);
}

.lm-hamburger.is-open .bar2 {
  opacity: 0;
}

.lm-hamburger.is-open .bar3 {
  transform: rotate(-45deg) translateY(-8px);
}

.lm-hidden { display: none; }

.lm-mobile-nav {
  background: var(--bg);
  padding: 0 18px 20px;
}

.lm-mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lm-mobile-nav-link {
  font-family: var(--font-titles-bold);
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 2;
  padding: 2px 8px;
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.lm-mobile-nav-link:hover,
.lm-mobile-nav-link.is-active {
  color: var(--accent);
}

.lm-mobile-copyright {
  padding-left: 8px;
}

/* -----------------------------------------------
   Gallery (Homepage)
   ----------------------------------------------- */
.home-template .lm-body {
  overflow: hidden;
}

.lm-gallery-page {
  height: 100vh;
}

.lm-gallery-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.lm-gallery-wrapper::-webkit-scrollbar {
  display: none;
}

.lm-gallery-grid {
  display: flex;
  align-items: start;
  height: 100vh;
}

.lm-gallery-item {
  flex-shrink: 0;
  height: 100vh;
  max-height: 100dvh;
}

.lm-gallery-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.lm-gallery-scrollbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
}

.lm-gallery-scrollbar-width {
  height: 1px;
}

/* -----------------------------------------------
   Grid Overview
   ----------------------------------------------- */
.lm-grid-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--nav-bg, #ffffff);
  color: var(--nav-text, var(--text));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s, background 0.6s ease, color 0.6s ease;
}

.lm-grid-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.lm-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  overflow-y: auto;
  display: none;
}

.lm-grid-overlay.is-open {
  display: block;
}

.lm-grid-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 310;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}

.lm-grid-close:hover {
  transform: scale(1.1);
}

.lm-grid-masonry {
  padding: 60px 20px 40px;
  columns: 5;
  column-gap: 8px;
}

.lm-grid-masonry .lm-grid-thumb {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 3px;
  break-inside: avoid;
  will-change: transform, opacity;
}

.lm-grid-masonry .lm-grid-thumb:hover {
  filter: brightness(1.05);
}

@media (max-width: 1200px) {
  .lm-grid-masonry { columns: 4; }
}

@media (max-width: 768px) {
  .lm-grid-masonry { columns: 3; padding: 60px 12px 30px; }
  .lm-grid-btn { bottom: 20px; right: 20px; top: auto; }
}

@media (max-width: 480px) {
  .lm-grid-masonry { columns: 2; }
}

/* -----------------------------------------------
   Page / Post content area
   ----------------------------------------------- */
.lm-page {
  padding: 96px 20px 64px;
  max-width: 1140px;
  margin: 0 auto;
}

.lm-page-hero img,
.lm-post-hero img {
  width: 100%;
  height: auto;
  margin-bottom: 32px;
}

.lm-page-title,
.lm-post-title {
  font-family: var(--font-titles-bold);
  font-weight: 400;
  font-size: 32px;
  color: var(--text);
  margin-bottom: 16px;
}

.lm-post-header {
  margin-bottom: 32px;
}

.lm-post-tag {
  display: inline-block;
  font-family: var(--font-titles-bold);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-right: 12px;
}

.lm-post-date {
  font-family: var(--font-titles-light);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  opacity: 0.7;
}

/* Ghost content styles */
.gh-content {
  font-size: 15px;
  line-height: 1.7;
}

.gh-content h2 {
  font-family: var(--font-titles-bold);
  font-weight: 400;
  font-size: 24px;
  color: var(--text);
  margin: 48px 0 24px;
}

.gh-content h3 {
  font-family: var(--font-titles-bold);
  font-weight: 400;
  font-size: 20px;
  color: var(--text);
  margin: 32px 0 12px;
}

.gh-content h4 {
  font-weight: 700;
  margin: 24px 0 8px;
}

.gh-content p {
  margin-bottom: 16px;
}

.gh-content a {
  color: var(--accent);
  text-decoration: underline;
}

.gh-content img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
}

.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 24px 0;
  font-style: italic;
}

.gh-content ul, .gh-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.gh-content li {
  margin-bottom: 8px;
}

.gh-content hr {
  border: none;
  border-top: 1px solid rgba(109, 105, 97, 0.2);
  margin: 32px 0;
}

/* Ghost card styles */
.gh-content .kg-gallery-container {
  margin: 24px 0;
}

.gh-content .kg-gallery-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.gh-content .kg-gallery-image img {
  width: 100%;
  height: auto;
}

.gh-content .kg-width-wide {
  margin-left: -40px;
  margin-right: -40px;
}

.gh-content .kg-width-full {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.gh-content .kg-bookmark-card {
  border: 1px solid rgba(109, 105, 97, 0.2);
  border-radius: 4px;
  margin: 24px 0;
}

.gh-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: var(--text);
}

.gh-content .kg-bookmark-content {
  flex: 1;
  padding: 16px;
}

.gh-content .kg-bookmark-title {
  font-weight: 700;
  font-size: 15px;
}

.gh-content .kg-bookmark-description {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 8px;
}

.gh-content .kg-bookmark-thumbnail {
  width: 200px;
}

.gh-content .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}

/* Buttons (for books page buy links etc) */
.gh-content .lm-btn,
.gh-content a[class*="btn"] {
  display: inline-block;
  background: var(--btn);
  color: white;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 32px;
  border-radius: 9999px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.gh-content .lm-btn:hover,
.gh-content a[class*="btn"]:hover {
  opacity: 0.9;
  color: white;
}

/* -----------------------------------------------
   About page specifics
   ----------------------------------------------- */
.lm-page-about .gh-content .kg-gallery-row,
.lm-page-about .gh-content .kg-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* -----------------------------------------------
   Archive / Tag / Author
   ----------------------------------------------- */
.lm-archive-header {
  margin-bottom: 32px;
}

.lm-archive-title {
  font-family: var(--font-titles-bold);
  font-weight: 400;
  font-size: 24px;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lm-archive-description {
  font-size: 15px;
  opacity: 0.7;
}

.lm-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.lm-archive-card {
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.15s;
}

.lm-archive-card:hover {
  opacity: 0.8;
}

.lm-archive-card-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 12px;
}

.lm-archive-card-title {
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
}

/* -----------------------------------------------
   Error page
   ----------------------------------------------- */
.lm-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.lm-error-content {
  text-align: center;
}

.lm-error-code {
  font-family: var(--font);
  font-weight: 700;
  font-size: 72px;
  color: var(--accent);
}

.lm-error-message {
  font-size: 18px;
  margin: 16px 0 32px;
}

.lm-error-link {
  color: var(--accent);
  text-decoration: underline;
  font-size: 16px;
}

/* -----------------------------------------------
   Pagination
   ----------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
  font-size: 14px;
}

.pagination a {
  color: var(--accent);
}

/* -----------------------------------------------
   Desktop (md+)
   ----------------------------------------------- */
@media (min-width: 769px) {
  .lm-sidebar {
    display: block;
  }

  .lm-mobile-header {
    display: none;
  }

  /* Gallery: desktop horizontal scroll */
  body.home-template {
    overflow: hidden;
  }

  .lm-gallery-scrollbar {
    display: block;
  }

  /* Pages offset for sidebar */
  .lm-page {
    padding-left: 280px;
    padding-right: 40px;
    padding-top: 32px;
  }

  .lm-page-about .gh-content .kg-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .gh-content .kg-width-wide {
    margin-left: -40px;
    margin-right: -40px;
  }
}

/* -----------------------------------------------
   Mobile
   ----------------------------------------------- */
@media (max-width: 768px) {
  .lm-sidebar {
    display: none !important;
  }

  .lm-mobile-header {
    display: block;
  }

  /* Gallery: vertical stacking on mobile */
  body.home-template {
    overflow: auto !important;
  }

  .lm-gallery-page {
    height: auto;
  }

  .lm-gallery-wrapper {
    overflow: visible !important;
    height: auto !important;
  }

  .lm-gallery-grid {
    flex-direction: column;
    align-items: center;
    height: auto !important;
  }

  .lm-gallery-item {
    height: auto !important;
    width: 100vw !important;
  }

  .lm-gallery-item:first-child {
    padding-top: 80px;
  }

  .lm-gallery-img {
    height: auto !important;
    width: 100% !important;
  }

  .lm-gallery-scrollbar {
    display: none !important;
  }

  .lm-page {
    padding-top: 96px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .lm-page-about .gh-content .kg-cols-3 {
    grid-template-columns: 1fr;
  }

  .gh-content .kg-width-wide {
    margin-left: -20px;
    margin-right: -20px;
  }
}
