/* ============================================================
   XJS Soft Tops Club — CAR ALBUM BROWSE VIEW
   Hero + story mats + polaroids (front-end view mode)
   ============================================================ */

/* ============================================================
   HERO WRAPPER
   ============================================================ */

.car-album-wrapper {
  max-width: 1200px;
  margin: 0 auto 32px auto;
  padding: 0 16px;
}

.car-album-softpaper {
  background: var(--soft-cream);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  padding: 24px;
}

/* Desktop-only top spacing for hero block */
@media (min-width: 992px) {
  .car-album-wrapper {
    margin-top: 40px;
  }
}

/* 40/60 hero layout */
.car-album-hero-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
}

.car-album-hero-photo {
  flex: 0 0 40%;
  min-width: 260px;
}

.car-album-hero-meta {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.caralbum-spec-item {
  margin-bottom: 4px;
}

/* 4:3 frame */
.softphoto {
  width: 100%;
}
.softphoto-inner {
  width: 100%;
}
.softphoto-4x3 {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  border-radius: 10px;
}
.softphoto-4x3 {
  position: relative;
  width: 100%;
  padding-top: 75%;              /* 4:3 frame */
  overflow: hidden;
  border-radius: 10px;
  background: var(--soft-cream); /* matte lives on the frame */
}

.softphoto-4x3 img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: contain;
}


/* Stack hero on narrow screens */
@media (max-width: 768px) {
  .car-album-hero-inner {
    flex-direction: column;
  }
  .car-album-hero-photo,
  .car-album-hero-meta {
    flex: 1 1 100%;
  }
}

/* Album last updated line in hero */
.caralbum-updated-line {
  margin-top: 42px;
  font-size: 0.95rem;
  color: var(--soft-green);
  opacity: 0.85;
}


/* ============================================================
   GENERIC BLOCK WRAPPER (ABOUT / STORIES)
   ============================================================ */

.caralbum-block {
  max-width: 1200px;
  margin: 0 auto 32px auto;
  padding: 0 16px;
}

/* Top section heading */
.caralbum-section-title {
  margin: 0;
  padding: 14px 22px;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  background: var(--theme-neutral-header);
  color: #ffffff;
}

/* Section title per theme */
.caralbum-block.theme-about         .caralbum-section-title { background: var(--theme-about-tab); }
.caralbum-block.theme-wip           .caralbum-section-title { background: var(--theme-wip-tab); }
.caralbum-block.theme-restoration   .caralbum-section-title { background: var(--theme-restoration-tab); }
.caralbum-block.theme-maintenance   .caralbum-section-title { background: var(--theme-maintenance-tab); }
.caralbum-block.theme-modification  .caralbum-section-title { background: var(--theme-modification-tab); }
.caralbum-block.theme-trip          .caralbum-section-title { background: var(--theme-trip-tab); }
.caralbum-block.theme-adventure     .caralbum-section-title { background: var(--theme-adventure-tab); }
.caralbum-block.theme-awards        .caralbum-section-title { background: var(--theme-awards-tab); }
.caralbum-block.theme-future        .caralbum-section-title { background: var(--theme-future-tab); }

/* Neutral blocks (Intro / ownership etc.) */
.caralbum-block.caralbum-neutral {
  background: var(--theme-neutral-bg);
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

/* Inner padding for neutral blocks */
.caralbum-neutral-inner {
  padding: 24px 26px 26px;
}

/* Ownership grid (if used) */
.ownership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 28px;
  font-size: 1rem;
  margin-bottom: 20px;
}

.caralbum-text {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ============================================================
   THEN & NOW (IF USED)
   ============================================================ */

.caralbum-then-now-row {
  padding: 20px 26px 26px;
}

.caralbum-then-row {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.caralbum-subsection-title {
  margin-top: 0;
  font-size: 1.3rem;
}

.caralbum-then-now-text {
  margin-bottom: 18px;
}

/* Reuse polaroid grid for Then & Now (4-wide on desktop) */
.caralbum-photo-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1024px) {
  .caralbum-photo-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .caralbum-photo-grid-4 {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   UNIVERSAL STORY SECTIONS (TABLE MATS)
   ============================================================ */

/* Section “dinner mat” behind stories */
.caralbum-block.theme-about       { background: var(--theme-about-mat);       border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-wip         { background: var(--theme-wip-mat);         border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-restoration { background: var(--theme-restoration-mat); border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-maintenance { background: var(--theme-maintenance-mat); border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-modification{ background: var(--theme-modification-mat);border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-trip        { background: var(--theme-trip-mat);        border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-adventure   { background: var(--theme-adventure-mat);   border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-awards      { background: var(--theme-awards-mat);      border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }
.caralbum-block.theme-future      { background: var(--theme-future-mat);      border-radius: 14px; box-shadow: var(--soft-shadow); padding-bottom: 20px; }

/* Each story on its own softpaper card */
.caralbum-story.softpaper-story-card {
  background: var(--soft-cream);
  border-radius: 16px;
  margin: 18px 18px 0 18px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  padding: 22px 24px 24px;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Story header (banner + date/location line area) */
.caralbum-story-header {
  grid-column: 1 / -1;
  margin: -22px -24px 16px -24px;  /* let banner touch card edges */
  padding-bottom: 20px;
}

/* Tab-style banner at top of each story */
.caralbum-story-banner {
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 16px 16px 0 0;
}

/* Theme-specific banner colours */
.caralbum-block.theme-about       .caralbum-story-banner { background: var(--theme-about-tab);       color: var(--theme-about-text); }
.caralbum-block.theme-wip         .caralbum-story-banner { background: var(--theme-wip-tab);         color: var(--theme-wip-text); }
.caralbum-block.theme-restoration .caralbum-story-banner { background: var(--theme-restoration-tab); color: var(--theme-restoration-text); }
.caralbum-block.theme-maintenance .caralbum-story-banner { background: var(--theme-maintenance-tab); color: var(--theme-maintenance-text); }
.caralbum-block.theme-modification.caralbum-block .caralbum-story-banner,
.caralbum-block.theme-modification .caralbum-story-banner { background: var(--theme-modification-tab); color: var(--theme-modification-text); }
.caralbum-block.theme-trip        .caralbum-story-banner { background: var(--theme-trip-tab);        color: var(--theme-trip-text); }
.caralbum-block.theme-adventure   .caralbum-story-banner { background: var(--theme-adventure-tab);   color: var(--theme-adventure-text); }
.caralbum-block.theme-awards      .caralbum-story-banner { background: var(--theme-awards-tab);      color: var(--theme-awards-text); }
.caralbum-block.theme-future      .caralbum-story-banner { background: var(--theme-future-tab);      color: var(--theme-future-text); }

/* Date & location lines */
.caralbum-story-date,
.caralbum-story-location {
  margin: 8px 0 0 18px;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Main two-column layout (text + photos) */
.caralbum-story-main {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .caralbum-story-main {
    grid-template-columns: 1fr;
  }
}

/* Text column */
.caralbum-story-text {
  font-size: 0.98rem;
  line-height: 1.6;
}


/* ============================================================
   POLAROID GRID + CARDS
   ============================================================ */

.caralbum-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.polaroid-card {
  background: #fffdf6;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Polaroid image frame */
.polaroid-img {
  width: 100%;
  height: 190px;
  object-fit: contain;              /* SHOW FULL IMAGE */
  background-color: var(--photo-matte, #e6e0cf);
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}


.polaroid-caption {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.polaroid-excerpt {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

/* “More” button */
.polaroid-more {
  align-self: flex-start;
  font-size: 0.85rem;
  border: none;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--soft-green);
  color: var(--soft-cream);
}

/* Expanded description */
.polaroid-full {
  font-size: 0.9rem;
  margin-top: 6px;
}
.polaroid-full.hidden {
  display: none;
}
/* ============================================================
   MOBILE ALBUM BROWSE TOOLBAR
   Single source of truth
   ============================================================ */

/* Hidden by default (desktop) */
.album-mobile-browse-bar {
  display: none;
}

/* Mobile only */
@media (max-width: 768px) {

  body.single-car_album .album-mobile-browse-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    justify-content: space-between;
    gap: 12px;

    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));

    background: rgba(26, 59, 46, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25);

    border-top-left-radius: 18px;
    border-top-right-radius: 18px;

    z-index: 999999;
    pointer-events: auto;
  }

  /* Buttons — matched to mobile editor bar */
  body.single-car_album .album-mobile-browse-bar .softbtn {
    flex: 1;
    max-width: 45%;
    min-height: 38px;

    padding: 8px 14px;
    font-size: 14px;

    background: #1a3b2e;
    color: #eae3d1;

    border: 2px solid rgba(234, 227, 209, 0.65);
    border-radius: 12px;
  }

  /* Prevent horizontal bleed */
  body.single-car_album {
    overflow-x: hidden;
  }
}
/* above is the tool bar */

/* -------------------------------------------------
   Story header spacing (browse)
-------------------------------------------------- */

.caralbum-section-title {
    margin-bottom: 0.6em;
}

.caralbum-story-header {
    margin-top: 0.6em;
    padding-top: 0.5em;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.caralbum-story-date,
.caralbum-story-location {
    display: block;
    font-size: 0.95em;
    line-height: 1.4;
    color: #555;
    margin: 0.15em 0;
}
/* ----------------------------------------
   Story meta + description row
---------------------------------------- */

.caralbum-story-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.caralbum-story-meta {
  font-size: 0.95rem;
  color: #555;
}

.caralbum-story-meta p {
  margin: 0 0 6px;
}

.caralbum-story-content {
  max-width: 60ch;
}

/* ----------------------------------------
   Full-width photo grid
---------------------------------------- */

.caralbum-photo-grid-full {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 20px;
}


/* Browse: photos full width (5 across desktop) */
.caralbum-photo-grid--fullwidth{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 18px;
}

/* Responsive */
@media (max-width: 900px){
  .caralbum-story-main--split{
    grid-template-columns: 1fr;
  }
  .caralbum-photo-grid--fullwidth{
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Photo matte colours per story theme */
.caralbum-block.theme-about        { --photo-matte: #e3e8df; }
.caralbum-block.theme-wip          { --photo-matte: #e6e1d2; }
.caralbum-block.theme-maintenance  { --photo-matte: #efe6d4; }
.caralbum-block.theme-restoration  { --photo-matte: #e7d7cf; }
.caralbum-block.theme-modification { --photo-matte: #dfe6e1; }
.caralbum-block.theme-trip         { --photo-matte: #dde8f0; }
.caralbum-block.theme-adventure    { --photo-matte: #d7e1ee; }
.caralbum-block.theme-awards       { --photo-matte: #efe7cf; }
.caralbum-block.theme-future       { --photo-matte: #ededed; }

.polaroid-img {
  background-image: linear-gradient(
    rgba(0,0,0,0.03),
    rgba(0,0,0,0.03)
  );
}

/* ============================================================
   STORY PHOTOS — SQUARE FRAME (BROWSE)
============================================================ */

.polaroid-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--soft-cream);
  border-radius: 8px;
}
/* ============================================================
   SOFT LIGHTBOX
   ============================================================ */

#soft-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 59, 46, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 4vh 4vw;
}

#soft-lightbox.active {
  display: flex;
}

#soft-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: var(--soft-cream);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.soft-lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  font-size: 42px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
}

.soft-lightbox-close:hover {
  opacity: 1;
}
/* Hide browse/edit UI while lightbox is open */
body:has(#soft-lightbox.active) .album-mobile-browse-bar,
body:has(#soft-lightbox.active) .album-editor-toolbar,
body:has(#soft-lightbox.active) .album-browse-toolbar {
  opacity: 0;
  pointer-events: none;
}
