/*
 * WordPress additions on top of the compiled design (lovable.css):
 * pop-up open state, native form controls, single posts and editor content.
 */

html.pb-dialog-open { overflow: hidden; }
.project-dialog:focus { outline: none; }
.project-card[hidden] { display: none; }

/* ---- Show pop-up: banner and clips on the left, credits and description on the right.
   Stacked (banner, three clips, then text) on tablets and phones. ---- */
/* The top edge stays at a fixed spot (not centred), so the arrows don't move when clicking through shows of different lengths. */
.project-dialog { width: min(1240px, 100% - 48px); top: 5dvh; transform: translateX(-50%); max-height: 90dvh; }
.dialog-toolbar { position: sticky; top: 0; z-index: 2; background: var(--background); }
.dialog-body {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px; padding: 20px 36px 40px 16px; align-items: start;
}
/* The banner and clips stay in view while a long description scrolls. */
.dialog-visual { position: sticky; top: 76px; }
.dialog-media { border-radius: 3px; overflow: hidden; }
.dialog-visual .video-clips { margin-top: 24px; }
.dialog-visual .video-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dialog-visual .video-options .clip-option { width: auto; flex: none; }
.clips-more {
  margin-top: 12px; padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px;
}
.dialog-copy { padding: 0; }
.dialog-credits { padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.dialog-credits h2 { margin: 0; font-size: 42px; line-height: 1.08; }
.dialog-credits .dialog-network {
  margin-top: 8px; font-size: 13px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary);
}
.dialog-credits .dialog-role {
  margin: 22px 0 0; font-family: var(--font-display); font-size: 22px; line-height: 1.25;
  color: var(--foreground); font-weight: 500; text-wrap: balance;
}
.dialog-credits > p.dialog-years, .dialog-credits > p.dialog-production { margin-top: 6px; font-size: 14px; line-height: 1.6; }
.dialog-credits .dialog-years { margin-top: 8px; }
.dialog-production a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.dialog-production a:hover { color: var(--primary); }
.dialog-credits > p.dialog-logline {
  margin-top: 18px; font-size: 17px; line-height: 1.55; color: var(--foreground); overflow-wrap: normal;
}
.dialog-credits [hidden] { display: none; }
.project-dialog .original-description { margin-top: 22px; font-size: 14px; }

@media (max-width: 1024px) {
  .project-dialog { width: calc(100% - 32px); top: 3dvh; max-height: 94dvh; }
  .dialog-body { grid-template-columns: 1fr; gap: 28px; padding: 16px 16px 32px; }
  .dialog-copy { padding-inline: 12px; }
  .dialog-visual { position: static; }
  .dialog-visual .video-clips { margin-top: 18px; }
  /* One row of three clips until "Show more". */
  .video-clips:not(.is-expanded) .clip-option:nth-child(n+4) { display: none; }
  .dialog-credits h2 { font-size: 34px; }
}
@media (min-width: 1025px) { .clips-more { display: none; } }
@media (max-width: 700px) {
  .project-dialog { width: calc(100% - 20px); top: 10px; max-height: calc(100dvh - 20px); }
  .dialog-body { padding: 10px 10px 26px; gap: 22px; }
  .dialog-copy { padding-inline: 8px; }
  .dialog-visual .video-options { gap: 8px; }
  .dialog-credits h2 { font-size: 30px; }
  .dialog-credits .dialog-role { font-size: 19px; margin-top: 16px; }
  .dialog-credits > p.dialog-logline { font-size: 16px; }
}

/* Fixed header sits below the WordPress admin bar when logged in. */
body.admin-bar .portfolio-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .portfolio-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .portfolio-header.is-scrolled { top: 0; } }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Native checkbox in the contact form. */
.copy-checkbox input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; cursor: pointer;
  accent-color: var(--primary);
}
.form-status { margin-top: 14px; font-size: 13px; color: var(--muted-foreground); }
.menu-toggle [data-icon-open], .menu-toggle [data-icon-close],
.subpage-menu-toggle [data-icon-open], .subpage-menu-toggle [data-icon-close],
.contact-arrow [data-icon-open], .contact-arrow [data-icon-close] { display: inline-flex; }

/* Pagination extras. */
.blog-pagination { flex-wrap: wrap; align-items: center; }
.blog-pagination a:hover { border-color: var(--primary); color: var(--primary); }
.blog-pagination .pagination-gap { border: 0; padding-inline: 2px; color: var(--muted-foreground); }
.blog-post-image img { width: 100%; aspect-ratio: 730 / 410; object-fit: cover; }

/* ---- Single post ---- */
.single-post-page { padding-block: 64px 80px; }
/* Featured image: full column width, whole image shown (no cropping). */
.single-post-banner { margin: 0 0 40px; }
.single-post-banner img { display: block; width: 100%; height: auto; border-radius: 3px; }
/* article only: WordPress also puts a .single-post class on <body>. 835px = the old 668px column + 25%. */
article.single-post { max-width: 835px; margin-inline: auto; }
/* Tablets and phones: the post fills the screen, keeping only a small text gutter. */
@media (max-width: 1024px) {
  .single-post-page.content-width { width: calc(100% - 40px); }
  article.single-post { max-width: none; }
}
.single-post-back {
  display: inline-block; margin-bottom: 28px; font-size: 13px;
  color: var(--muted-foreground); text-decoration: none;
}
.single-post-back:hover { color: var(--primary); }
.single-post-header .journal-meta { justify-content: flex-start; gap: 18px; margin-top: 0; font-size: 11px; letter-spacing: .08em; }
.single-post-header .journal-meta span { color: var(--primary); }
.single-post-header h1 {
  font-family: var(--font-display); font-size: 52px; line-height: 1.1;
  margin: 14px 0 36px; text-wrap: balance;
}
.single-post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border);
}
.single-post-nav a { font-family: var(--font-display); font-size: 20px; line-height: 1.3; text-decoration: none; }
.single-post-nav a:hover { color: var(--primary); }
.single-post-nav a span {
  display: block; margin-bottom: 6px; font-family: var(--font-sans, inherit);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground);
}
.single-post-nav .is-older { text-align: right; grid-column: 2; }

/* ---- Editor content: posts and pages written in WordPress ---- */
.entry-content { font-size: 16px; line-height: 1.85; color: var(--muted-foreground); }
.entry-content > * + * { margin-top: 22px; }
.entry-content h2, .entry-content h3, .entry-content h4,
.imported-content h2, .imported-content h3, .imported-content h4 { color: var(--foreground); }
.entry-content h2 { font-family: var(--font-display); font-size: 34px; line-height: 1.2; margin-top: 44px; }
.entry-content h3 { font-family: var(--font-display); font-size: 26px; line-height: 1.25; margin-top: 36px; }
.entry-content h4 { font-size: 17px; font-weight: 600; margin-top: 30px; }
.entry-content a, .imported-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover, .imported-content a:hover { text-decoration-thickness: 2px; }
.entry-content strong, .entry-content b { color: var(--foreground); }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: 8px; }
.entry-content blockquote {
  border-left: 2px solid var(--primary); padding-left: 20px;
  color: var(--foreground); font-size: 18px;
}
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin-block: 40px; }
.entry-content img, .imported-content img { max-width: 100%; height: auto; border-radius: 3px; }
.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object {
  display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0;
}
.entry-content .wp-caption, .imported-content .wp-caption { max-width: 100%; }
.entry-content .wp-caption-text, .imported-content .wp-caption-text {
  margin-top: 8px; font-size: 12px; color: var(--muted-foreground); text-align: center;
}
.entry-content .aligncenter, .imported-content .aligncenter { display: block; margin-inline: auto; }
.entry-content .alignleft, .imported-content .alignleft { float: left; margin: 6px 24px 16px 0; max-width: 50%; }
.entry-content .alignright, .imported-content .alignright { float: right; margin: 6px 0 16px 24px; max-width: 50%; }
.entry-content::after { content: ""; display: block; clear: both; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.entry-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.entry-content .gallery br { display: none; }
.entry-content .gallery-item { margin: 0; }
.entry-content .gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.resume-intro > p { margin-bottom: 0; }

@media (max-width: 760px) {
  .single-post-page { padding-block: 36px 50px; }
  .single-post-header h1 { font-size: 36px; }
  .single-post-nav { grid-template-columns: 1fr; }
  .single-post-nav .is-older { grid-column: 1; text-align: left; }
  .entry-content .alignleft, .entry-content .alignright { float: none; margin: 0 0 16px; max-width: 100%; }
}

.pb-video { aspect-ratio: 16 / 9; background: var(--card); }
.pb-video iframe { width: 100%; height: 100%; border: 0; }

/* Websites page: every group is three across on desktop, and the portfolio rows run as one continuous grid. */
@media (min-width: 701px) {
  .websites-page .import-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .websites-page .import-grid + .import-grid { border-top: 0; margin-top: 48px; padding-top: 0; }
}
@media (max-width: 700px) {
  .websites-page .import-grid + .import-grid { border-top: 0; margin-top: 40px; padding-top: 0; }
}

/* Inline links in the homepage About paragraphs */
.about-copy > p a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.about-copy > p a:hover { color: var(--primary); }

/* Résumé intro: phone and email on one line, then a blank line before the PDF button */
.resume-intro > p.resume-contact { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 20px 0 32px; font-size: 15px; }
.resume-contact a { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); }
.resume-contact a:hover { color: var(--primary); }
.resume-contact svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
@media (max-width: 480px) { .resume-intro > p.resume-contact { gap: 8px 20px; font-size: 14px; } .resume-contact a { gap: 6px; } }

/* Résumé header: round headshot cropped to head and shoulders, sitting next to the intro */
.resume-heading-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 64px; }
.resume-heading-layout .resume-intro { max-width: none; }
.resume-profile { aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.resume-profile img { aspect-ratio: 1; height: 100%; margin: 0; border-radius: 0; object-position: 50% 0; transform: scale(1.3); transform-origin: 50% 12%; }
@media (width <= 800px) { .resume-heading-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; } }
@media (width <= 700px) { .resume-heading-layout { grid-template-columns: 1fr; } .resume-profile { width: 220px; order: -1; justify-self: center; } }

/* "More" dropdown: left edge lines up with the left edge of the "More" label */
.nav-more .nav-more-menu { left: 0; right: auto; }
.portfolio-header .nav-more .nav-more-menu { left: 16px; } /* trigger has px-4 padding on the homepage */
.entry-content img.is-full-width, .imported-content img.is-full-width { display: block; width: 100%; }
.entry-content p:has(img.is-full-width), .imported-content p:has(img.is-full-width) { max-width: none; }

/* Video grids (e.g. One Second Everyday): three across on desktop with the first row showing, then "Load all…";
   on mobile one column with the first two showing, then "Load more…" */
.import-video-grid .import-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.import-video-grid .import-video { margin-bottom: 0; }
.import-video-grid:not(.is-expanded) .import-entry:nth-child(n+4) { display: none; }
.video-load-more { display: inline-block; margin-top: 24px; padding: 0; background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.import-video-grid.is-expanded .video-load-more, .video-load-more .is-mobile { display: none; }
@media (max-width: 700px) {
  .import-video-grid .import-grid { grid-template-columns: 1fr; }
  .import-video-grid:not(.is-expanded) .import-entry:nth-child(n+3) { display: none; }
  .video-load-more .is-mobile { display: inline; }
  .video-load-more .is-desktop { display: none; }
}
@media (min-width: 701px) { .import-video-grid.has-one-row .video-load-more { display: none; } }
