/* =====================================================
   EDITOR UI — CLEAN, STABLE, FINAL
===================================================== */

/* -------------------------------
   BASE RESET
-------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #2b579a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  
  color: #000;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}


/* =====================================================
   APP ROOT (STACKING CONTEXT)
===================================================== */

.editor-app {
  position: relative;
  z-index: 1;               /* ← critical */
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* =====================================================
   DESKTOP BACKGROUND LAYER
===================================================== */

.desktop-layer {
  position: fixed;
  inset: 0;
  padding: 24px;

  /* 🔑 create stacking context */
  z-index: 0;
  isolation: isolate;

  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.15), transparent 40%),
    linear-gradient(#2b579a, #1b3c6d);
}

.desktop-layer::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image: url('/assets/images/desktop-photos/presidential-seal.png');
  background-repeat: no-repeat;

  /* ⬇️ offset from center */
  background-position: 6% 25%;
  /* or: 52% 48%, left 55% top 46%, etc */

  background-size: 800px;
  opacity: 0.09;

  z-index: 1;
  pointer-events: none;
}



/* Desktop icons (explicit hit areas restored later if needed) */
.desktop-icon {
  display: block;
  width: 140px;
  margin-bottom: 28px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  pointer-events: auto;
}

.desktop-icon .icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.desktop-icon .label {
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.desktop-icon:hover .label {
  text-decoration: underline;
}

/* =====================================================
   EDITOR WINDOW (WORD)
===================================================== */

.editor-window {
  position: relative;
  z-index: 2;

  width: min(900px, 94vw);
  height: 82vh;
  margin: 40px auto;

  background: #f2f2f2;
  border: 1px solid #9c9c9c;

  box-shadow:
    0 8px 24px rgba(0,0,0,0.25),
    inset 0 0 0 1px #ffffff;

  display: flex;
  flex-direction: column;
}

/* -------------------------------
   MENU BAR
-------------------------------- */

.editor-menu {
  display: flex;
  gap: 18px;
  padding: 6px 12px;
  font-size: 13px;
  background: #e5e5e5;
  border-bottom: 1px solid #b5b5b5;
  user-select: none;
}

.menu-item {
  position: relative;
}

.menu-label {
  padding: 6px 8px;
  cursor: default;
}

/* Dropdown */
.submenu {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #8f8f8f;
  z-index: 9999;
}

.menu-item:hover .submenu,
.submenu:hover {
  display: block;
}

.submenu a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
}

.submenu a:hover {
  background: #2b579a;
  color: #fff;
}

/* -------------------------------
   TITLE BAR
-------------------------------- */

.editor-title {
  padding: 4px 12px;
  font-size: 12px;
  background: #dcdcdc;
  border-bottom: 1px solid #bcbcbc;
}

/* -------------------------------
   TOOLBAR
-------------------------------- */

.editor-toolbar {
  padding: 6px 12px;
  background: #efefef;
  border-bottom: 1px solid #cfcfcf;
}

.toolbar-btn {
  margin-right: 12px;
  font-size: 12px;
  text-decoration: none;
  color: #000;
}

/* -------------------------------
   DOCUMENT
-------------------------------- */

.editor-document {
  flex: 1;
  background: #fff;
  padding: 36px 48px;
  overflow-y: auto;

  font-family: "Courier Prime", monospace;
  font-size: 15px;
  line-height: 1.6;
}

.editor-document p {
  margin: 0 0 14px;
}

/* =====================================================
   INLINE EDITOR ADS (DOCUMENT-NATIVE)
===================================================== */

.editor-ad {
  margin: 28px 0;
  font-family: "Courier Prime", monospace;
}

.editor-ad-inner {
  border: 1px solid #9c9c9c;
  background: #f7f7f7;
}

.editor-ad-badge {
  padding: 6px 12px;
  background: #e6e6e6;
  border-bottom: 1px solid #9c9c9c;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.editor-ad-content {
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
}

.editor-ad-cta {
  font-size: 13px;
  text-decoration: underline;
}

/* =====================================================
   ARCHIVE / SEARCH FILE LIST
===================================================== */

.editor-document ul {
  list-style: none;
  padding: 0;
}

.editor-document li {
  padding: 6px 0;
}

.editor-document li a {
  color: #000;
  text-decoration: none;
}

.editor-document li a::before {
  content: "📄 ";
}

.editor-document li a:hover {
  text-decoration: underline;
}

/* =====================================================
   MOBILE — EDITOR FIRST
===================================================== */

@media (max-width: 768px) {

  body {
    background: #d4d0c8;
  }

  /* Desktop → top strip */
  .desktop-layer {
    position: static;
    display: flex;
    justify-content: space-around;
    align-items: center;

    padding: 10px 6px;
    background: #cfcfcf;
    border-bottom: 1px solid #9a9a9a;
    pointer-events: auto;
  }

  .desktop-icon {
    width: auto;
    margin: 0;
  }

  .desktop-icon .icon {
    font-size: 26px;
    margin-bottom: 2px;
  }

  .desktop-icon .label {
    font-size: 11px;
    color: #000;
    text-shadow: none;
  }

  /* Editor fills viewport */
  .editor-window {
    width: 100%;
    height: auto;
    margin: 0;
    border: none;
    box-shadow: none;
  }

  .editor-menu {
    position: sticky;
    top: 0;
    z-index: 3000;
  }

  .editor-document {
    padding: 16px 14px 24px;
    font-size: 16px;
  }
}

/* =====================================================
   EDITOR MENU — WORD-STYLE (menu-group version)
===================================================== */

.editor-menu {
  display: flex;
  gap: 18px;
  padding: 6px 12px;
  font-size: 13px;
  background: #e5e5e5;
  border-bottom: 1px solid #b5b5b5;
  user-select: none;
  position: relative;
  z-index: 5000;
}

/* Each top-level menu */
.editor-menu .menu-group {
  position: relative;
}

/* Click / hover target */
.editor-menu .menu-label {
  display: inline-block;
  padding: 6px 8px;
  cursor: default;
  color: #000;
  white-space: nowrap;
}

/* Hover highlight like Word */
.editor-menu .menu-group:hover .menu-label {
  background: #d0d0d0;
}

/* Dropdown panel */
.editor-menu .menu-dropdown {
  display: none;
  position: absolute;

  /* overlap by 1px to avoid hover gap */
  top: calc(100% - 1px);
  left: 0;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* KEEP OPEN when hovering parent OR dropdown */
.editor-menu .menu-group:hover .menu-dropdown,
.editor-menu .menu-dropdown:hover {
  display: block;
}

/* Dropdown items */
.editor-menu .menu-dropdown a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

/* Hover state */
.editor-menu .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}

/* =====================================================
   EDITOR DOCUMENT — SPONSORED INSERT
   (Styles existing ad-card markup as Word-style block)
===================================================== */

.editor-document .ad-card.ad-native {
  display: block;
  margin: 28px 0;
  text-decoration: none;
  color: #000;
  font-family: "Courier Prime", monospace;
}

/* Card shell */
.editor-document .ad-card-inner {
  border: 1px solid #9c9c9c;
  background: #f7f7f7;
}

/* Header strip (replaces pill badge) */
.editor-document .ad-badge {
  display: block;
  padding: 6px 12px;
  background: #e6e6e6;
  border-bottom: 1px solid #9c9c9c;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

/* Content */
.editor-document .ad-content {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

/* Headline */
.editor-document .ad-headline {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

/* Body copy */
.editor-document .ad-copy {
  margin: 0 0 8px;
  font-style: italic;
  color: #444;
}

/* CTA link */
.editor-document .ad-cta {
  font-size: 13px;
  text-decoration: underline;
  color: #000;
}

.editor-document .ad-cta::before {
  content: "External link: ";
  color: #666;
}

/* Subtle hover — document, not card */
.editor-document .ad-card.ad-native:hover .ad-card-inner {
  background: #f0f0f0;
  border-color: #6b6b6b;
}

/* =====================================================
   PHOTOS WINDOW
===================================================== */



.photos-window {
  position: fixed;
  top: 120px;
  left: 180px;
  width: 640px;
  height: 420px;

  background: #f2f2f2;
  border: 1px solid #9c9c9c;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);

  display: none;              /* 🔑 THIS */
  flex-direction: column;
  z-index: 3000;
}


/* Title bar */
.photos-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #dcdcdc;
  border-bottom: 1px solid #bcbcbc;
  font-size: 13px;
}

.photos-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* Grid */
.photos-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  overflow-y: auto;
  background: #ffffff;
}

.photos-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid #ccc;
  cursor: pointer;
}



.photo-viewer {
  display: none; /* critical */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}


.photo-viewer img {
  max-width: 90vw;
  max-height: 90vh;
}

.photo-viewer button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.viewer-prev { left: 20px; }
.viewer-next { right: 20px; }
.viewer-close { top: 20px; right: 20px; }

.photos-titlebar {
  background: #e5e5e5;
  padding: 6px 10px;
  border-bottom: 1px solid #b5b5b5;

  display: flex;
  justify-content: space-between;
  align-items: center;

  cursor: move;
  user-select: none;
}

/* =====================================================
   MOBILE LAYOUT — FINAL, AUTHORITATIVE
===================================================== */

@media (max-width: 768px) {

  /* ---- Reset flow ownership ---- */

  body {
    background: #d4d0c8;
    overflow-y: auto;
  }

  .editor-app {
    display: block;
    min-height: auto;
  }

  /* ---- Desktop becomes top bar ---- */

  .desktop-layer {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;

    padding: 8px 6px;
    background: #cfcfcf;
    border-bottom: 1px solid #9a9a9a;

    z-index: 5;
  }

  .desktop-layer::before {
    display: none; /* no watermark on mobile */
  }

  .desktop-icon {
    width: auto;
    margin: 0;
  }

  .desktop-icon .icon {
    font-size: 24px;
    margin-bottom: 2px;
  }

  .desktop-icon .label {
    font-size: 11px;
    color: #000;
    text-shadow: none;
  }

  /* ---- Editor is primary viewport ---- */

  .editor-window {
    position: relative;
    width: 100%;
    height: auto;
    margin: 0;

    border: none;
    box-shadow: none;
  }

  /* Sticky Word menu */
  .editor-menu {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  /* Disable hover dropdowns on mobile (tap-only UX later) */
  .editor-menu .menu-dropdown {
    display: none !important;
  }

  /* ---- Document scroll ---- */

  .editor-document {
    padding: 16px 14px 24px;
    font-size: 16px;

    overflow: visible; /* body scrolls */
  }

  /* ---- Photos window = fullscreen modal ---- */

  .photos-window {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;
    left: 0 !important;
    top: 0 !important;

    border: none;
    box-shadow: none;
    z-index: 9999;
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

}
@media (max-width: 768px) {

   
  .editor-menu {
    display: none;
  }



  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    background: #f7f7f7;
    z-index: 9999;

    display: flex;
    flex-direction: column;
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 16px;
    background: #e6e6e6;
    border-bottom: 1px solid #9a9a9a;
  }

  .mobile-menu-title {
    font-size: 16px;
    font-weight: 600;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
  }

  .mobile-menu-links {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .mobile-menu-links a {
    font-size: 18px;
    text-decoration: none;
    color: #000;
  }

  .mobile-menu-links hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 8px 0;
  }
}
/* =====================================================
   MOBILE MENU — HARD CLOSED BY DEFAULT
===================================================== */

.mobile-menu-panel {
  display: none;
}

.mobile-menu-panel.is-open {
  display: block;
}

/* =====================================================
   MOBILE TOP BAR (HOME + HAMBURGER)
===================================================== */

@media (max-width: 768px) {

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 4000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 8px 12px;
    background: #e5e5e5;
    border-bottom: 1px solid #b5b5b5;

    font-size: 14px;
  }

  .mobile-home {
    text-decoration: underline;
    color: #2b579a;
    font-weight: 600;
  }

  .mobile-menu-toggle {
    background: #f2f2f2;
    border: 1px solid #9c9c9c;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
  }
}

/* =====================================================
   MOBILE MENU PANEL
===================================================== */

@media (max-width: 768px) {

  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    z-index: 5000;

    background: #f2f2f2;
    display: none;
    flex-direction: column;
  }

  .mobile-menu-panel.is-open {
    display: flex;
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 12px;
    background: #dcdcdc;
    border-bottom: 1px solid #bcbcbc;
  }

  .mobile-menu-title {
    font-size: 14px;
    font-weight: 600;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
  }

  .mobile-menu-links {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
  }

  .mobile-menu-links a {
    text-decoration: none;
    color: #000;
  }

  .mobile-menu-links a:hover {
    text-decoration: underline;
  }

  .mobile-menu-links hr {
    margin: 12px 0;
    border: none;
    border-top: 1px solid #bbb;
  }
}


/* =====================================================
   FOOTER — FLOATING DESKTOP TEXT
===================================================== */

.footer {
  position: relative;
  z-index: 2; /* above desktop layer */

  max-width: 900px;
  margin: 18px 50px 36px;
  padding: 0 18px;

  font-size: 13px;
  line-height: 1.5;
  text-align: left;

  color: rgba(255,255,255,0.6);
}

/* Links */
.footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Spacing */
.footer p {
  margin: 6px 0;
}


@media (max-width: 768px) {
  .footer {
    margin: 20px 0 28px;
    padding: 16px 14px;

    background: #ffffff;   /* 🔑 THIS is missing */
    
    font-size: 14px;
    color: #444;
    text-align: center;
  }

  /* 🔑 selector fix: .footer a (not footer a) */
  .footer a {
    color: #2b579a;
    text-decoration: none;
  }

  .footer a:hover {
    text-decoration: underline;
  }
}

/* Toolbar layout helpers */
.editor-toolbar {
  display: flex;
  align-items: center;
}

.toolbar-spacer {
  flex: 1;
}

/* Share dropdown alignment */
.menu-dropdown-right {
  right: 0;
  left: auto;
}

.menu-dropdown hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0;
}

@media print {
  body {
    background: #fff !important;
  }

  .desktop-layer,
  .editor-menu,
  .editor-toolbar {
    display: none !important;
  }

  .editor-window {
    border: none;
    box-shadow: none;
    height: auto;
  }

  .editor-document {
    padding: 0;
    font-size: 12pt;
  }
}
@media print {
  body {
    background: #fff !important;
  }

  .desktop-layer,
  .editor-menu,
  .editor-toolbar {
    display: none !important;
  }

  .editor-window {
    border: none;
    box-shadow: none;
    height: auto;
  }

  .editor-document {
    padding: 0;
    font-size: 12pt;
  }
}

/* =====================================================
   EDITOR TOOLBAR — HARD STYLING FIX
   (Overrides legacy + menu CSS)
===================================================== */

.editor-window .editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 6px 10px;
  background: #efefef;
  font-size: 12px;
}

/* Push actions to right */
.editor-window .toolbar-spacer {
  flex: 1;
}

/* Buttons */
.editor-window .toolbar-btn {
  appearance: none;
  background: #f5f5f5;
  border: 1px solid #bcbcbc;
  border-radius: 2px;

  padding: 4px 10px;
  font-size: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #000;

  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.editor-window .toolbar-btn:hover {
  background: #e6e6e6;
}

.editor-window .toolbar-btn:active {
  background: #dcdcdc;
}

/* =====================================================
   SHARE DROPDOWN — EDITOR ONLY
===================================================== */

.editor-window .toolbar-share {
  position: relative;
}

/* Ensure dropdown appears above document */
.editor-window .toolbar-share .menu-dropdown {
  display: none;
  position: absolute;

  top: calc(100% + 2px);
  right: 0;
  left: auto;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;

  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* Show on hover */
.editor-window .toolbar-share:hover .menu-dropdown {
  display: block;
}

/* Dropdown links */
.editor-window .toolbar-share .menu-dropdown a {
  display: block;
  padding: 6px 12px;

  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.editor-window .toolbar-share .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}

/* Divider */
.editor-window .toolbar-share .menu-dropdown hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0;
}

/* =====================================================
   PRINT — LETTER ONLY
===================================================== */

@media print {

  /* ---------- GLOBAL RESET ---------- */

  * {
    background: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.6;
  }

  /* ---------- HIDE ALL UI ---------- */

  .desktop-layer,
  .editor-menu,
  .editor-toolbar,
  .mobile-bar,
  .mobile-menu-panel,
  .photos-window,
  .photo-viewer,
  .footer,
  .editor-ad,
  .ad-card,
  .toolbar-share,
  .toolbar-btn {
    display: none !important;
  }

  /* ---------- EDITOR WINDOW ---------- */

  .editor-window {
    all: unset;
    display: block;
    width: 100%;
  }

  /* ---------- DOCUMENT CONTENT ---------- */

  .editor-document {
    all: unset;
    display: block;

    padding: 1in;
    max-width: 7.5in;
    margin: 0 auto;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
  }

  /* Paragraphs = clean blocks */
  .editor-document p {
    margin: 0 0 14pt;
    text-align: left;
    white-space: normal;
  }

  /* Links print as text */
  .editor-document a {
    color: #000;
    text-decoration: none;
  }

  /* Optional: show URLs after links */
  .editor-document a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #555;
  }

  /* ---------- PAGE CONTROL ---------- */

  @page {
    margin: 1in;
  }

}

.editor-meta {
  padding: 6px 12px;
  font-size: 12px;
  color: #555;
  background: #fafafa;
  border-bottom: 1px solid #d0d0d0;
  text-align: left;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================================================
   TOOLBAR SHARE — STABLE HOVER FIX
===================================================== */

/* Parent must be hover container */
.toolbar-share {
  position: relative;
}

/* Button */
.toolbar-share .toolbar-btn {
  cursor: default;
}

/* Dropdown panel */
.toolbar-share .menu-dropdown {
  display: none;
  position: absolute;

  /* 🔑 overlap parent by 1px */
  top: calc(100% - 1px);
  right: 0;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);

  z-index: 9999;
}

/* Keep open when hovering parent OR dropdown */
.toolbar-share:hover .menu-dropdown,
.toolbar-share .menu-dropdown:hover {
  display: block;
}

/* Invisible hover bridge (kills gap) */
.toolbar-share::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

/* Dropdown links */
.toolbar-share .menu-dropdown a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.toolbar-share .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}
