.applegram-gallery-link { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 28px 0 18px; border-top: 1px solid var(--line); }
.applegram-gallery-link .button { background: var(--green); color: var(--cream); }
.applegram-gallery-link p { margin: 0; }
.applegram-main { max-width: 620px; margin: auto; padding: 40px 20px 115px; }
.applegram-intro { text-align: center; margin-bottom: 32px; }
.applegram-intro h1 { font: clamp(2.8rem, 7vw, 4rem)/1.1 var(--serif); color: var(--green); margin: 12px 0; }
.applegram-intro p { line-height: 1.6; }
.applegram-status { text-align: center; line-height: 1.6; }
.applegram-card { border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; overflow: hidden; margin-bottom: 28px; }
.applegram-card header { display: flex; align-items: center; gap: 12px; padding: 16px; }
.applegram-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--cream); flex-shrink: 0; font-weight: 700; }
.applegram-author { font-weight: 700; color: var(--green); }
.applegram-date { display: block; font-size: 0.75rem; color: #6c7069; margin-top: 4px; }
.applegram-card > img { width: 100%; height: auto; max-height: 780px; object-fit: contain; display: block; background: #ece7db; }
.applegram-caption { padding: 18px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.98rem; line-height: 1.6; }
.applegram-post-button { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 40; padding: 13px 30px; border: 1px solid #f3e5cd; border-radius: 40px; background: var(--green); color: var(--cream); font: 600 1.05rem var(--sans); cursor: pointer; box-shadow: 0 5px 20px #142d2740; }
.applegram-post-button span { font-size: 1.3rem; margin-right: 6px; }
.applegram-more { margin: 20px auto; }
#post-dialog { width: min(480px, calc(100vw - 28px)); max-height: 86svh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); }
#post-dialog::backdrop { background: #172b22b8; }
#post-dialog h2 { font: 2.2rem/1.1 var(--serif); margin: 12px 0 24px; }
.applegram-close { display: block; margin-left: auto; border: 1px solid var(--line); background: transparent; padding: 7px 10px; color: inherit; cursor: pointer; }
#post-form label { display: block; margin: 16px 0 8px; font-size: 0.9rem; font-weight: 600; }
#post-form input:not([type=file]), #post-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fffdf7; color: var(--ink); padding: 11px; font: inherit; box-sizing: border-box; }
#post-form input[type=file] { width: 100%; font: inherit; font-size: 0.9rem; }
#photo-preview { width: 100%; max-height: 280px; object-fit: contain; margin-top: 16px; border-radius: 6px; }
.applegram-sharing-note, #post-status { font-size: 0.85rem; line-height: 1.5; }
#post-form .button { background: var(--green); color: var(--cream); width: 100%; cursor: pointer; }
#post-form .button:disabled { opacity: 0.55; cursor: wait; }
.applegram-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.applegram-page [hidden] { display: none !important; }
.applegram-page .ribbon [aria-current=page] { border-color: var(--cream); font-weight: 700; }

/* Keep the festival footer at the page bottom, including an empty feed. */
.applegram-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.applegram-page > .site-header,
.applegram-page > .ribbon,
.applegram-page > footer { flex-shrink: 0; }
.applegram-page > .applegram-main { flex: 1; width: 100%; margin: 0 auto; }
.applegram-page > footer { margin-top: auto; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* AppleGram: a darker orchard backdrop and playful graffiti lettering. */
.applegram-page { background: #152c24; color: #f4eedf; }
.applegram-page > .applegram-main { box-sizing: border-box; max-width: 680px; padding: 38px 22px 105px; }
.applegram-intro { margin-bottom: 8px; }
.applegram-intro .applegram-logo {
  position: relative; isolation: isolate; display: flex; justify-content: center;
  gap: 0; font-family: Impact, 'Arial Black', sans-serif; font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 900; font-style: italic; letter-spacing: -0.055em; line-height: 1.15;
  color: #eeb54e; text-shadow: 3px 4px 0 #152c24, 6px 7px 0 #e36a48;
  -webkit-text-stroke: 1.5px #f4eedf; margin: 8px 0 16px;
}
.applegram-logo span:first-child { transform: rotate(-5deg); }
.applegram-logo span:last-child { color: #ef7655; transform: rotate(4deg) translateY(5px); }
.applegram-logo::after { content: ''; position: absolute; bottom: -9px; width: 66%; height: 7px; border-radius: 70% 15% 60% 30%; background: #eeb54e; transform: rotate(-4deg); z-index: -1; }
.applegram-illustration { display: block; width: min(100%, 380px); height: auto; margin: 26px auto 0; }
.applegram-status { color: #f4eedf; font-weight: 600; font-size: 1.15rem; margin: 12px 0 32px; }
.applegram-card { color: #223328; }
.applegram-page > footer { margin-top: auto; padding: 20px 5% calc(22px + env(safe-area-inset-bottom)); color: #f4eedf; background: #10221b; border-top: 1px solid #f4eedf30; }
.applegram-page > footer a { border-bottom-color: #f4eedf80; }
@media (max-width: 480px) {
  .applegram-page > .applegram-main { padding-top: 28px; }
  .applegram-page > footer { gap: 18px; flex-wrap: wrap; }
  .applegram-page > footer strong { font-size: 1.45rem; }
  .applegram-illustration { width: min(100%, 300px); }
}

/* Leave the bottom footer links clear of the floating Post control. */
.applegram-page .applegram-post-button { bottom: calc(104px + env(safe-area-inset-bottom)); }
@media (max-width: 480px) { .applegram-page .applegram-post-button { bottom: calc(130px + env(safe-area-inset-bottom)); } }

/* The cream header needs dark text independently of the dark page theme. */
.applegram-page > .site-header { color: var(--ink); }
