/* bapas-diary.com on phones (Darpan typed yes to the phone design, 24 Oct 2026).
   Website only: nothing here touches the daily 2pm picture. tools/web_phone.py adds this file and phone.js to every
   page at deploy time. Everything is inside one media query, so computers and tablets keep the pages exactly as they are.
   On a phone: the shared menu becomes a tab bar at the bottom for the thumb (Today, Calendar, Search, Travels, Years),
   About moves to a round "i" at the top right, buttons are at least 44px, and photos open full screen on black. */
@media (max-width: 760px) {
  :root { --ph-bar: calc(62px + env(safe-area-inset-bottom, 0px)); }

  /* the tab bar */
  nav.site-menu, nav.site-menu.stay {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 60; height: var(--ph-bar);
    display: flex; justify-content: space-around; align-items: stretch; gap: 0; overflow: visible;
    padding: 5px max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background: rgba(18, 4, 8, .96); border-top: 1px solid rgba(217, 164, 65, .28);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    opacity: 1; transform: none; border-radius: 0; border-width: 1px 0 0; box-shadow: none;   /* the Calendar page has its own .stay */
  }
  nav.site-menu a {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 0; margin: 0 2px; border: 0; border-radius: 14px;
    font: 700 11px/1 Arimo, Arial, Helvetica, sans-serif; letter-spacing: .03em; text-transform: none; color: #c9a56a;
  }
  nav.site-menu a::before {
    content: ""; width: 24px; height: 24px; background: currentColor;
    -webkit-mask: var(--ph-icon) center / contain no-repeat; mask: var(--ph-icon) center / contain no-repeat;
  }
  nav.site-menu a:hover, nav.site-menu a.on { color: #ffe296; border: 0; }
  nav.site-menu a.on { background: rgba(217, 164, 65, .16); }
  nav.site-menu a[href="/about/"] { display: none; }
  nav.site-menu a[href="/through-the-years/"] { font-size: 0; }
  nav.site-menu a[href="/through-the-years/"]::after { content: "Years"; font-size: 11px; }
  nav.site-menu a[href="/"] { --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E"); }
  nav.site-menu a[href="/calendar/"] { --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
  nav.site-menu a[href^="/search/"] { --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E"); }
  nav.site-menu a[href="/travels/"] { --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.6 2.6 3.8 5.6 3.8 9s-1.2 6.4-3.8 9c-2.6-2.6-3.8-5.6-3.8-9S9.4 5.6 12 3z'/%3E%3C/svg%3E"); }
  nav.site-menu a[href="/through-the-years/"] { --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2.5'/%3E%3Ccircle cx='12' cy='10' r='3.2'/%3E%3Cpath d='M7 18c1-2.6 2.8-4 5-4s4 1.4 5 4'/%3E%3C/svg%3E"); }

  /* the top strip, in the 46px every page already keeps free for the old menu */
  .ph-top { position: absolute; z-index: 55; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 46px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
  .ph-top > * { pointer-events: auto; }
  .ph-brand { font: 500 17px/1 "EB Garamond", "Diary Garamond", Garamond, serif; letter-spacing: .04em; color: #d9a441; text-decoration: none; }
  .ph-about { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #ffe296; border: 1px solid rgba(217, 164, 65, .45); background: rgba(18, 4, 8, .45); }
  .ph-about svg { width: 20px; height: 20px; }
  .ph-fixed .ph-top { position: fixed; }

  /* room for the tab bar under every page */
  body { padding-bottom: var(--ph-bar); }
  .bd-toast { bottom: calc(var(--ph-bar) + 14px); }

  /* Today */
  .datebar .pill, .controls .pill, .controls select { min-height: 44px; }
  .datebar { gap: 8px 6px; }   /* Back to today, when shown, goes on its own line under the three */
  .datebar .pill { padding-inline: 12px; letter-spacing: .08em; white-space: nowrap; }
  .page .sub { letter-spacing: .24em; padding-left: .24em; white-space: nowrap; }
  .page .sub::before, .page .sub::after { width: 28px; }
  .ph-switch { display: flex; gap: 4px; padding: 4px; margin: 18px auto 0; max-width: 420px; border-radius: 16px; border: 1px solid rgba(217, 164, 65, .35); }
  .ph-switch button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: none; cursor: pointer; color: #e8cf9c; font: 700 12px/1 Arimo, Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
  .ph-switch button[aria-pressed="true"] { background: linear-gradient(#ffe296, #ce9840); color: #3a0d17; }
  html.ph-one #cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 22px;
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 16px 11vw 6px; }
  html.ph-one #cards::-webkit-scrollbar { display: none; }
  html.ph-one #cards .slot { flex: 0 0 78vw; scroll-snap-align: center; }
  html.ph-one .ph-hint-one { display: block; }
  .ph-hint-one { display: none; text-align: center; margin: 4px 0 0; font: 400 13px/1.3 Arimo, Arial, sans-serif; color: rgba(250, 241, 222, .62); }
  html.ph-all #cards { grid-template-columns: repeat(var(--ph-cols, 2), minmax(0, 1fr)); column-gap: calc(28px / var(--ph-cols, 2)); }
  html.ph-all.ph-c3 #cards .yr { font-size: 17px; }
  html.ph-all.ph-c3 #cards .ti, html.ph-all.ph-c3 #cards .cap { font-size: 12px; }
  html.ph-all.ph-c4 #cards .yr { font-size: 14px; }
  html.ph-all.ph-c4 #cards .pl, html.ph-all.ph-c4 #cards .fest, html.ph-all.ph-c4 #cards .of { font-size: 7px; letter-spacing: .08em; }
  html.ph-all.ph-c4 #cards .ti { display: none; }
  html.ph-all.ph-c4 #cards .cap { font-size: 11px; min-height: 0; }
  html.ph-all.ph-c4 #cards .photo .words p, html.ph-all.ph-c4 #cards .photo.story p { font-size: 10px; }
  html.ph-all.ph-c1 #cards .yr { font-size: 30px; }
  html.ph-all.ph-c1 #cards .pl { font-size: 12px; }
  html.ph-all.ph-c1 #cards .cap { font-size: 18px; }
  .ph-zoom { position: fixed; z-index: 50; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(var(--ph-bar) + 14px); display: none; flex-direction: column;
    border-radius: 26px; overflow: hidden; background: rgba(30, 8, 14, .95); border: 1px solid rgba(217, 164, 65, .45); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
  html.ph-all.ph-board .ph-zoom { display: flex; }
  .ph-zoom button { width: 52px; height: 52px; border: 0; background: none; color: #ffe296; display: grid; place-items: center; cursor: pointer; padding: 0; }
  .ph-zoom button + button { border-top: 1px solid rgba(217, 164, 65, .3); }
  .ph-zoom button:disabled { opacity: .35; cursor: default; }
  .ph-zoom svg { width: 22px; height: 22px; }

  /* a photo opens full screen, on black, over the tab bar */
  .viewer { z-index: 70; background: #000; padding-inline: 0; }
  .viewer .vtop { padding-inline: 14px; }
  .viewer .vframe { background: none; padding: 0; box-shadow: none; }
  .viewer .vframe img { max-width: 100vw; max-height: calc(100dvh - 250px); }
  .viewer .vcap { color: #f3e6cc; padding-inline: 18px; max-width: 100vw; }
  .viewer .vcap p { font-size: 21px; }
  .viewer .vcap div { color: #d9a441; font-size: 11px; }
  .viewer .vnav { padding-inline: 12px; }
  .viewer .pill { min-height: 48px; padding-inline: 18px; }
  .picker { z-index: 70; }
  .picker .months button { width: 44px; height: 44px; }

  /* Calendar: the months scroll up and down on a phone (phone.js draws them; the sideways ribbon stays on computers) */
  html.ph-cal .app { display: none; }
  html.ph-cal body { overflow: hidden; }
  .ph-cal-wrap { position: fixed; z-index: 1; left: 0; right: 0; top: calc(46px + env(safe-area-inset-top, 0px)); bottom: var(--ph-bar);
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; font-family: "EB Garamond", Garamond, serif; color: #f8f2e4; }
  .ph-cal-wrap::-webkit-scrollbar { display: none; }
  .ph-years { position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 16px 10px; background: linear-gradient(#3a0e19 82%, rgba(58, 14, 25, 0)); }
  .ph-years::-webkit-scrollbar { display: none; }
  .ph-years button { flex: none; min-width: 60px; height: 38px; border-radius: 19px; border: 1px solid rgba(217, 164, 65, .3); background: none; color: #e8cf9c; font: 700 13px/1 Arimo, Arial, sans-serif; cursor: pointer; }
  .ph-years button[aria-pressed="true"] { background: linear-gradient(#ffe296, #ce9840); color: #3a0d17; border-color: transparent; }
  .ph-month { box-sizing: border-box; padding-bottom: 26px; }
  .ph-mt { position: sticky; top: 54px; z-index: 2; display: flex; justify-content: center; align-items: baseline; gap: 10px; padding: 6px 16px 8px; background: rgba(42, 10, 18, .94); }
  .ph-mt b { font: 500 27px/1 "EB Garamond", Garamond, serif; color: #ffe296; }
  .ph-mt span { font: 700 12px/1 Arimo, Arial, sans-serif; letter-spacing: .2em; color: #d9a441; }
  .ph-stays { position: relative; min-height: 52px; box-sizing: border-box; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px 0; }
  .ph-stays::-webkit-scrollbar { display: none; }
  .ph-stay { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(255, 226, 150, .07); border: 1px solid rgba(217, 164, 65, .22); }
  .ph-stay b { font: 600 16px/1 "EB Garamond", Garamond, serif; color: #ffe296; }
  .ph-stay small { font: 400 11px/1 Arimo, Arial, sans-serif; color: #e8cf9c; }
  .ph-stay.on { border-color: #ffe296; background: rgba(255, 226, 150, .16); }
  .ph-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 14px 16px 0; }
  .ph-grid .wk { text-align: center; font: 700 11px/1 Arimo, Arial, sans-serif; color: #d9a441; padding-bottom: 6px; }
  .ph-day { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 9px; overflow: hidden; cursor: pointer; background: rgba(255, 226, 150, .06); color: #e8cf9c; font: 600 17px/1 "EB Garamond", Garamond, serif; }
  .ph-day img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
  .ph-day i { position: absolute; left: 4px; top: 3px; font: 700 10px/1 Arimo, Arial, sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
  .ph-day.fest::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: #ffe296; box-shadow: 0 0 0 1.5px rgba(22, 5, 9, .7); }
  .ph-day[aria-pressed="true"] { outline: 2.5px solid #ffe296; outline-offset: 1px; }
  .ph-card { position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(var(--ph-bar) + 10px); display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 18px;
    background: rgba(30, 8, 14, .97); border: 1px solid rgba(217, 164, 65, .4); box-shadow: 0 10px 26px rgba(0, 0, 0, .5); text-decoration: none; color: #f3e6cc; }
  .ph-card img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; object-position: 50% 22%; flex: none; }
  .ph-card .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 30px 4px 2px; }
  .ph-card .k { font: 700 11px/1.2 Arimo, Arial, sans-serif; letter-spacing: .1em; color: #d9a441; text-transform: uppercase; }
  .ph-card .p { font: 600 20px/1.1 "EB Garamond", Garamond, serif; color: #ffe296; }
  .ph-card .c { font: italic 400 15px/1.25 "EB Garamond", Garamond, serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ph-card::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 400 30px/1 "EB Garamond", serif; color: #d9a441; }
  .ph-card[hidden] { display: none; }
  .ph-cal-wrap.has-card { padding-bottom: 120px; }

  /* Travels and Through the years: their bottom controls sit above the tab bar */
  html.ph-travels .rail { bottom: var(--ph-bar); }
  html.ph-travels .story { bottom: calc(236px + var(--ph-bar)); }
  html.ph-travels .hint { bottom: calc(180px + var(--ph-bar)); }
  html.ph-years-page body { padding-bottom: calc(10px + var(--ph-bar)); }
}
