@charset "UTF-8";

/* --- Global Resets & Base --- */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit;
  vertical-align: baseline; box-sizing: border-box;
}
article, aside, details, figcaption, figure, figcaption, footer, header, hgroup,
menu, nav, section, main { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
img, video { max-width: 100%; height: auto; display: block; }

/* --- Variables & Theming --- */
:root {
  --default-site-bg: #F7F7F7;
  --default-text-color: #003344;
  --h1-text-color-on-index: var(--default-text-color);
  --grid-line-color: #00000011;

  --font-main-h1: 'Questrial', sans-serif;
  font-weight: bold;
  --font-article-h1: 'Playfair Display', serif; /* Used for the main article title */
  --font-body: 'Questrial', sans-serif; /* General body copy font, if not PxGrotesk */
  --font-small-caps: 'PxGroteskRegular', sans-serif; /* For small caps/utility text */
  --font-menu-items: 'Questrial', sans-serif;

  /* NEW: Dynamic Highlight Color Variable */
  --dynamic-highlight-color: var(--default-text-color); /* Default if no color is set by JS */
}

html {
    width: 100%; height: 100%;
      /* background-color: var(--default-site-bg);*/
    transition: background-color 0.4s ease-in-out;
    scroll-behavior: smooth;
}

/* Updated Body styles for global consistency */
body {
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  zoom: 1;
  -webkit-font-smoothing: antialiased;
  /* MODIFIED: Combine background-color and background-image to ensure grid is visible */
  background: transparent; /* Explicitly set background color to transparent */
  background-image: linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
  background-size: 32px 32px; /* Keep this for the grid sizing */
  background-position: center center; /* Center the grid */
  /* End MODIFIED */

  color: var(--default-text-color); /* Use variable for default text color */
  font-family: var(--font-body); /* Default font-family for consistency */
  font-size: 1.7vw; /* Default font size for mid-range (761px - 1299px) */
  line-height: 1.5em;

  overflow-x: hidden;
  transition: color 1s; /* Keep transition for color changes */
  overflow-y: auto; /* Prevent global scrollbar */
}

@media (max-width: 760px) {
  body {
    font-size: 4vw;
  }
}
@media (min-width: 1300px) {
  body {
    font-size: 22px;
  }
}

body.yellow {
    --h1-text-color-on-index: #f8d11c;
    --dynamic-highlight-color: #f8d11c; /* ADD THIS LINE */
}
body.green  {
    --h1-text-color-on-index: rgb(41, 105, 64); /* CHANGE TO YOUR SPECIFIC DARK GREEN */
    --dynamic-highlight-color: rgb(41, 105, 64); /* ADD THIS LINE AND SET TO DARK GREEN */
}
body.blue   {
    --h1-text-color-on-index: #2248cd;
    --dynamic-highlight-color: #2248cd; /* ADD THIS LINE */
}
body.pink   {
    --h1-text-color-on-index: #aa3035;
    --dynamic-highlight-color: #aa3035; /* ADD THIS LINE */
}

/* Dimmed background and scaled grid when an article is open */
body.single .nav-container-inner {
    overflow-y: hidden;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 0.1; /* Dim the background grid */
    transform: scale(0.95); /* Slightly shrink the grid */
}

a { color: inherit; text-decoration: none; }

.block p {
    font-weight: 300;
}

/* --- Menu System (Adjusted to Match Torquetorque.net visuals) --- */
.menu-link {
  position: fixed; bottom: 3.33333vw; left: 3.33333vw;
  z-index: 10002; background: #fff; height: 56px; width: 56px;
  text-align: center; line-height: 56px; text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-small-caps);
  font-size: 11px; font-weight: 500;
  border-radius: 50%; color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer; transition: background-color 0.2s, color 0.2s;
}
.menu-link:after { content: 'Menu'; }
.show-menu .menu-link:after { content: 'Close'; }
.menu-link:hover { background: #f1f1f1; }
@media (min-width: 1300px) { .menu-link { bottom: 42.66667px; left: 42.66667px; } }
@media (max-width: 760px) { .menu-link { bottom: 15px; left: 15px; } }

.menu {
  position: fixed;
  left: 3.33333vw;
  bottom: calc(3.33333vw + 53px + 12px);

  z-index: 10001; background: #fff; padding: 28px 30px;
  display: none !important;
  font-family: var(--font-menu-items);
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1), 0 1px 5px rgba(0,0,0,0.05);
  border-radius: 3px;
  min-width: 240px;
}
body.show-menu .menu { display: block !important; }

@media (min-width: 1300px) {
    .menu { bottom: calc(42.66667px + 53px + 12px); left: 42.66667px; font-size: 15px; }
}
@media (max-width: 760px) { /* Mobile: Full screen menu */
    .menu {
        right: 0; left: 0; top: 0; bottom: 0 !important;
        padding: 5vh 25px 25px 25px;
        font-size: 1.15em;
        overflow-y: auto; border-radius: 0; box-shadow: none;
        border-top: 1px solid #eeeeee;
    }
}

.menu ul { margin-left: 18px; margin-top: 0.2em; }
@media (min-width: 1300px) { .menu ul { margin-left: 18px; } }
@media (max-width: 760px) { .menu ul { margin-left: 18px; } }
.menu li { position: relative; display: block; float: left; clear: both; margin-bottom: 2px; }
.menu > li { margin-bottom: 1em; }
.menu > li:last-child { margin-bottom: 0; }

.menu-title {
  text-transform: uppercase; font-family: var(--font-small-caps);
  font-size: 10px; font-weight: 500; line-height: 1.4;
  letter-spacing: 0.1em; color: #888;
  margin-bottom: 0.6em;
}

.menu ul li:before {
  content: '–'; position: absolute; left: -18px; top: 0.25em;
  color: #bbb; pointer-events: none; font-size: 1em;
}
.menu ul li.info-link:before { content: '+'; }
.menu ul li a { display: inline-block; padding: 2px 0; color: #222; transition: color 0.2s; }
.menu ul li:hover:before { content: '→'; color: var(--h1-text-color-on-index); }
.menu ul li a:hover { color: var(--h1-text-color-on-index); }
.menu ul li.visited > a { color: #888; text-decoration: line-through; }
.menu ul li.visited > a:hover { color: var(--h1-text-color-on-index); text-decoration: none; }
.menu ul li.current-item > a { font-weight: 600; color: var(--h1-text-color-on-index); }

/* --- Page Cover & Nav Cover (Loading) --- */
.page-cover {
  position: fixed; top:0;left:0;right:0;bottom:0;z-index:10000; background:rgba(240, 240, 240, 0.85); display: none !important;}
body.show-menu .page-cover { display: block !important; }

.nav-cover {
  position: fixed;
  top:0;left:0;right:0;bottom:0;
  z-index:9999;
  display: none;
}
body.loading .nav-cover {
  display: block !important; opacity: 1 !important; pointer-events: auto !important; cursor: wait !important;
}

/* --- Homepage Backgrounds and Main Title --- */
.nav-container {
  position: fixed; top:0;left:0;right:0;bottom:0;background-color:transparent;z-index:0;}
.nav-container-inner { position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;}
.nav {
  position:absolute;width:150vw;height:103vw;
  background-image:url("grid.svg");
  background-position:center center;background-size:4001px;opacity:0.08;}

h1.main-site-title {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 20; pointer-events: none;
  font-family: var(--font-main-h1);
  font-size: 180px; /* This is the large desktop size */
  font-weight: 700; line-height: 1.0;
  text-align: center; width: 90vw;
  color: var(--h1-text-color-on-index);
  transition: color 0.1s ease-out, font-size 0.2s ease-out;
} /* <--- The media query MUST go AFTER this closing brace */

/* ADD THIS NEW MEDIA QUERY FOR THE MAIN H1 TITLE ON MOBILE (IT SHOULD BE HERE) */
@media (max-width: 760px) {
    h1.main-site-title {
        font-size: 18vw !important; /* MODIFIED: Increased font size (try 8vw or 9vw) */
        width: calc(100% - 32px) !important; /* NEW: Allows text to span closer to edges (16px left/right) and wrap */
        /* You may need to adjust 'top' if it looks off after scaling, e.g., top: 44vh; */
    }
}

h1.main-site-title.image-title-active {
    font-size: 144px; /* 20% smaller than 180px */
}

h1.main-site-title.title-hovered { font-size: 80px; }

/* Homepage Image Grid (panned by pan.js) - it's within #index-content-wrapper */

section {
  position: fixed;
  top: 0;
  left: 0;
  width: 3000px;
  height: 2400px;

  display: grid;
  padding: 112px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);

  gap: 152px;

touch-action: none; to allow native panning
}

section a {
  display: block;
  height: 100%;

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

section img {
  max-width: 100%;
  max-height: 600px;
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 0 16px #00000000;
}



section.main-grid-section {
  position: fixed; top: 0; left: 0; width: 3400px; height: 3400px;
  padding: 112px; display: grid;
grid-template-columns: repeat(4, 1fr); /* Updated from previous turn */
  grid-template-rows: repeat(3, 1fr); gap: 176px; z-index: 10;
touch-action: none; to allow native panning
background-color: transparent;
}

section.main-grid-section a.hovered { z-index: 2 !important; }
body.hovered section.main-grid-section a.hovered img { opacity: 1; transform: scale(1.6); box-shadow: 0 0 16px rgba(0,0,0,0.2);}

/* State when an article is open: #index-content-wrapper should be dimmed/scaled/non-interactive */
body.single #index-content-wrapper {
    opacity: 0.1;
    transform: scale(0.9);
    pointer-events: none; /* Retained as per your request */
}

/* NEW: Adjust padding and gap for the main grid section on smaller screens */
@media (max-width: 760px) {
    section.main-grid-section {
        padding: 30px; /* Reduced padding for mobile screens */
        gap: 20px;     /* Reduced gap between grid items for mobile screens */
        /* You may also consider adjusting grid-template-columns here if you want fewer columns on mobile */
        /* e.g., grid-template-columns: repeat(3, 1fr); */
    }
}

/* --- AJAX Content Area (Modified for Display & Transform Animation) --- */
article.main-content-container#project-ajax-content-area {
  position: fixed;
      top: 0px;       /* NEW: Starts 50px from the top of the browser window */
    left: 0;         /* Ensures it starts from the left edge */
    width: 100%;     /* Ensures it spans the full width of the viewport */
    height: calc(100vh - 50px); /* NEW: Fills the remaining vertical space */
  right: 0;
  z-index: 10000;
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
  display: none;
  transform: translateY(100%);

  transition: transform 0.2s ease-out;

  /* --- MODIFIED: Added max-width and centering for the article container --- */
  max-width: 80vw; /* This controls the overall width of the article container */
  margin: 0 auto; /* This centers the article container horizontally */

  /* --- MODIFIED: Scrollbar hiding for IE/Edge and Firefox --- */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none;    /* Firefox */
}

article.main-content-container#project-ajax-content-area.slide-in {
  display: block;
  transform: translateY(0);
  pointer-events: auto;
  transition: transform 0.2s ease-out;
}

/* Content wrapper inside the article container, give this the solid white background */
.article-content-padded-inner {
    padding: clamp(30px, 5vh, 60px) clamp(20px, 5vw, 70px);
    /* max-width and margin are already set on #project-ajax-content-area,
       but keeping them here doesn't hurt if this inner div is meant to be smaller.
       In your original code, it was already present. */
    max-width: 80vw; /* Keeps the content within this width, if parent is wider */
    margin: 0 auto;  /* Centers content within its parent, if it has a max-width */
    background: #fff;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* --- Contact Form Styles (Add these to your style.css) --- */

.contact-form {
    display: flex;          /* Make the form a flex container */
    flex-direction: column; /* Stack its children (form-groups, button) vertically */
    gap: 20px;              /* Adds spacing between form fields and the button */
    width: 100%; /* Allows it to be responsive up to its max-width */
    max-width: 700px; /* Match intro paragraph width */
    margin: 0 auto 2em auto; /* No top margin, horizontally centered, 2em bottom margin */
    padding: 0; /* NEW: Remove padding from the form container itself to align precisely */
    background-color: transparent; /* NEW: Remove the pale grey background */
    border: none; /* Keep this from previous step */
    border-radius: 0; /* Keep this from previous step */
    box-shadow: none; /* Keep this from previous step */
}

/* Contact page intro block (selected by structure, works in AJAX-loaded content) */
#project-ajax-content-area > .introduction {
    margin: 0.5em auto 4em !important; /* Force larger gap below text block */
    max-width: 700px;
    font-size: 1.1em;
    line-height: 1.6em;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

/* Ensure gap between intro paragraph and first form label on contact layout. */
#project-ajax-content-area > .introduction + .contact-form {
    margin-top: 0 !important;
}

.form-group {
    margin-bottom: 1.1em; /* Slightly tighter vertical spacing */
}

.form-group label {
    display: block; /* Labels on their own line */
    margin-bottom: 0.5em; /* Space between label and input */
    font-family: var(--font-small-caps); /* Consistent with menu titles */
    font-size: 0.8em;
    text-transform: uppercase;
    color: #555;
    letter-spacing: 0.05em;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; /* Full width within its container */
    padding: 0.6em; /* ~25% smaller field height */
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: var(--font-body); /* Consistent with body text */
    font-size: 0.85em; /* ~15-25% smaller visual scale */
    color: var(--default-text-color);
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    background-color: #fff;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none; /* Remove default outline */
    border-color: var(--dynamic-highlight-color); /* Highlight on focus */
    box-shadow: 0 0 0 2px rgba(var(--dynamic-highlight-color-rgb, 0,0,0), 0.2); /* Soft glow */
}

.contact-form textarea {
    resize: vertical; /* Allow vertical resizing only */
    min-height: 90px; /* ~25% smaller minimum height */
}

/* Force the dynamic highlight color for the Contact page */
body.contact-page {
    --dynamic-highlight-color: #B58900; /* Sets the specific color for contact.html */
}

.submit-button {
    /* Keep all other existing styles for height, padding, borders, etc. */
    align-self: flex-end;   /* This is the key: it aligns the button to the right within the flex column */
    display: inline-block;
    padding: 0 1.8em;
    height: 56px;
    line-height: 56px;
    box-sizing: border-box;
    vertical-align: middle;
    text-align: center;

    background-color: #B58900 !important; /* FORCED: Hardcoded gold color for the button, now with !important */
    color: #fff !important; /* FORCED: Ensure white text, with !important */
    border: none;
    border-radius: 5px;
    font-family: var(--font-small-caps);
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, filter 0.2s ease-in-out;
}

.submit-button:hover {
    background-color: #111 !important; /* FORCED: Dark grey on hover, now with !important */
    filter: none !important; /* FORCED: Remove filter, now with !important */
}

/* Honeypot field for spam prevention: Keep this completely hidden */
.form-group.honeypot {
    position: absolute; /* Hide visually */
    left: -9999px; /* Move far off-screen */
    top: -9999px;
    opacity: 0; /* Fully invisible */
    pointer-events: none; /* Not interactive */
    height: 0; /* Take no space */
    width: 0;
    overflow: hidden;
}

/* Responsive adjustments for the form */
@media (max-width: 768px) {
    .contact-form {
      display: flex;
    flex-direction: column;
        padding: 0; /* Keep same effective width as intro text */
        margin: 0 auto 1.5em auto; /* Keep auto horizontal margin on mobile, and no top margin */
    }
    .form-group {
        margin-bottom: 1em;
    }
}

/* Responsive font-size adjustment for the padded inner content, if needed */
/* Removed specific font-size media queries to use a single vw-based value for dynamic scaling */
@media (min-width: 992px) {
  .article-content-padded-inner {
    /* Keeping this for potential future specific adjustments */
  }
}

@media (max-width: 768px) {
    .article-content-padded-inner {
        padding: clamp(20px, 4vh, 40px) clamp(15px, 3vw, 40px);
        min-height: auto;
    }
}


/* --- Default Styles for elements INSIDE .article-content-padded-inner --- */

/* Base font styles for general article body copy */
.article-content-padded-inner {
    /* General styles for the container's text */
    color: #111; /* Default body copy color */
    font-family: "PxGroteskRegular", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* --- MODIFIED: Adjusted base font size for scaling with viewport width --- */
    font-size: 2.2vw; /* Use this for responsive text scaling. Adjust as desired (e.g., 2vw, 2.5vw) */
    line-height: 1.5em;
    /* Removed pageFadeIn animation here too */
}

/* --- REMOVED specific font-size media queries from .article-content-padded-inner
     to allow the single 'vw' value above to control scaling universally. ---
@media (max-width: 760px) {
  .article-content-padded-inner {
    font-size: 4vw; // Mobile font size
  }
}
@media (min-width: 1300px) {
  .article-content-padded-inner {
    font-size: 22px; // Large desktop font size
  }
}
*/

.article-content-padded-inner a {
  color: var(--dynamic-highlight-color); /* Links themselves get the highlight color */
  text-decoration: none; /* No underline by default */
  transition: text-decoration 0.2s, color 0.2s; /* Add transition for smooth underline/color changes */
}
.article-content-padded-inner a:hover {
  color: var(--dynamic-highlight-color); /* Keep highlight color on hover */
  text-decoration: underline; /* Underline on hover */
  text-decoration-color: var(--dynamic-highlight-color); /* Underline matches highlight color */
}

.article-content-padded-inner ::selection {
  background: #eee;
  color: #111;
  text-shadow: none;
}

.article-content-padded-inner .item-title {
  text-align: center; margin-bottom: 2em; padding-bottom: 1em;
  border-bottom: 1px solid #efefef;
}
.article-content-padded-inner .item-title h1 {
    font-family: var(--font-body); /* Using --font-body for h1 inside article as it's typically a display font */
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* This is the specific large size for the main article title */
    font-weight: 700;
    line-height: 1.1;
    color: #282828;
    margin-top: 0.5em;
    letter-spacing: -0.02em;
}

/* Maintain specific style for the first paragraph / introduction */
.article-content-padded-inner .introduction {
  font-family: var(--font-body); /* Matches --font-body for headings */
  font-size: 1.2em; /* This is the larger size for the introduction, scales relative to parent .article-content-padded-inner */
  line-height: 1.6;
  margin-bottom: 2em;
  color: var(--dynamic-highlight-color); /* Uses dynamic highlight color */
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}
.article-content-padded-inner .introduction p:first-child::before { content: '— '; margin-right: 0.2em; }

/* Any other headings (h2, h3, etc.) should also use the larger/different font style */
.article-content-padded-inner h2,
.article-content-padded-inner h3,
.article-content-padded-inner h4,
.article-content-padded-inner h5,
.article-content-padded-inner h6 {
    font-family: var(--font-body); /* Or a specific heading font variable */
    font-weight: 700;
    color: #282828; /* Default color for subheadings */
    line-height: 1.2;
}
.article-content-padded-inner h2 { font-size: 2.2vw; /* Example size for h2, scales with viewport */ }
.article-content-padded-inner h3 { font-size: 1.8vw; /* Example size for h3, scales with viewport */ }
/* Add more specific sizes for h4, h5, h6 if needed */

.article-content-padded-inner .text-content-wrapper {
  max-height: 9em; /* Initial collapsed height */
  position: relative;
  overflow: hidden;
  transition: max-height 0.45s ease-out;
  margin-top: 1em;
  padding-bottom: 5em; /* Add space for fade effect */
  box-sizing: border-box;
}
.article-content-padded-inner .text-content-wrapper.expanded {
    max-height: 500em; /* Large enough to show all content */
    padding-bottom: 0;
}
.article-content-padded-inner .text-content-wrapper:not(.expanded)::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 5em; background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 90%);
  pointer-events: none; z-index: 1;
}

.article-content-padded-inner .text-wrapper-expand {
  display: block; text-align: center; max-width: 180px;
  margin: 1.5em auto 2.5em auto; padding: 0.6em 0.8em;
  border-top: 1px solid var(--dynamic-highlight-color);
  text-transform: uppercase;
  font-family: var(--font-small-caps);
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0;
  cursor: pointer;
  background-color: transparent;
  transition: color 0.2s, border-color 0.2s;
  color: var(--dynamic-highlight-color);
  text-decoration: none;
}

.article-content-padded-inner .block {
  margin-bottom: 1.5em; max-width: 700px; margin-left: auto; margin-right: auto;
}
.article-content-padded-inner strong { font-weight: 600; }
.article-content-padded-inner em { font-style: italic; }

/* Elements that should use the dynamic highlight color */
.large,
blockquote,
strong, /* Stays strong, but if you want *strong* to be highlight colored */
.introduction,
.article-content-padded-inner > p:first-of-type, /* This applies to the very first paragraph regardless of class */
.article-content-padded-inner .gallery-nav,
.article-content-padded-inner .text-wrapper-expand,
.article-content-padded-inner .title,
.caption {
    color: var(--dynamic-highlight-color);
}
/* If you want only *some* strong text to be highlighted, remove 'strong' from the above list
   and apply a class like `<strong class="highlight">` to your HTML, then add '.highlight' to the list. */


/* Gallery Styles */
.article-content-padded-inner .gallery {
  position: relative; max-width: 850px;
/* ADD THIS LINE TO CENTER IT */
  margin: 0 auto 1em auto; /* Reduced slider-to-title spacing by 50% */
}
.article-content-padded-inner .gallery-image {
  width: 100%;
  background: #f7f7f7;
  /* 'display: none;' remains for the initial hidden state */

  /* Set default display to flex and centering for all sizes */
  display: none;
  align-items: center;
  justify-content: center;

  /* Match the gallery viewport height exactly to avoid clipping/cropping */
  height: 100%;
  min-height: 0;
}
.article-content-padded-inner .gallery-image.visible {
    display: flex; /* This should already be 'flex' from previous steps */
}
.article-content-padded-inner .gallery-image img {
  display: inline-block; max-width: 100%; height: auto; max-height: 100%; object-fit: contain;
}
.article-content-padded-inner .gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-family: var(--font-small-caps);
  /* Optional: Adjust font size of gallery nav arrows to scale with viewport */
  /* font-size: 2vw; */ /* Consider if you want these to scale more aggressively */
  font-size: 1.2rem;
  width: 40px; height: 40px; line-height: 38px; text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.8); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: background-color 0.2s, color 0.2s; z-index: 5;
  text-decoration: none;
}
.article-content-padded-inner .gallery-nav:hover { background: #fff; color: #000; }
.article-content-padded-inner .gallery-nav.prev { left: 10px; }
.article-content-padded-inner .gallery-nav.next { right: 10px; }

/* Read More Functionality */
.article-content-padded-inner .text-content-wrapper {
  max-height: 9em; position: relative; overflow: hidden;
  transition: max-height 0.45s ease-out; margin-top: 1em;
}
.article-content-padded-inner .text-content-wrapper.expanded { max-height: 500em; }
.article-content-padded-inner .text-content-wrapper:not(.expanded)::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 5em; background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 90%);
  pointer-events: none; z-index: 1;
}
.article-content-padded-inner .text-wrapper-expand {
  display: block; text-align: center; max-width: 180px;
  margin: 1.5em auto 2.5em auto; padding: 0.6em 0.8em;
  border-top: 1px solid var(--dynamic-highlight-color);
  text-transform: uppercase;
  font-family: var(--font-small-caps);
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0;
  cursor: pointer;
  background-color: transparent;
  transition: color 0.2s, border-color 0.2s;
}
.article-content-padded-inner .text-wrapper-expand:hover {
    color: var(--default-text-color);       /* Text turns to default body color on hover */
    border-top-color: var(--default-text-color); /* Border turns to default body color on hover */
}

/* Meta Information Section */
.article-content-padded-inner .meta {
  padding-top: 2.5em; margin-top: 3.5em; border-top: 1px solid #eee;
  max-width: 700px; margin-left: auto; margin-right: auto;
  /* Added for two-column layout */
  display: grid;
  grid-template-columns: 1fr; /* Default to single column */
  gap: 1.5em 2em; /* Vertical and horizontal gap between grid items */
  align-items: start; /* ADDED: To allow columns to have unequal heights */
}

@media (min-width: 720px) {
  .article-content-padded-inner .meta {
    grid-template-columns: repeat(2, 1fr); /* Two equal columns for larger screens */
  }
}

.article-content-padded-inner .meta .row {
  margin-bottom: 1em; /* This margin will now be applied within each grid cell */
  display: flex;
  flex-direction: column; /* Stacks title and value vertically */
  border-bottom: none; /* Removes dividing lines */
  padding-bottom: 0; /* Remove padding if border is gone */
}

.article-content-padded-inner .meta .row:last-child {
    border-bottom: none;
    margin-bottom: 0; /* Remove bottom margin for the very last item */
}

/* If you need to remove border for elements that are last in their column,
   but not necessarily the last child overall, that would require more complex
   :nth-last-child-of-type rules within the grid. For now, the general :last-child is used. */


.article-content-padded-inner .title {
  width: 100%; /* Ensures title takes full width */
  font-family: var(--font-small-caps);
  font-size: 0.7rem;
  text-transform: uppercase; line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 5px; /* Added space between title and value */
}
.article-content-padded-inner .value {
  width: 100%; /* Ensures value takes full width */
  color: #444; line-height: 1.5;
  font-family: var(--font-body);
  text-align: left; /* Aligns value to the left, beneath the title */
}
@media (min-width: 600px) {
  .article-content-padded-inner .title { width: 100%; flex-basis: auto; min-width: 100px; margin-bottom: 5px; padding-right: 1em;}
  .article-content-padded-inner .value { width: 100%; flex-basis: auto; }
}
.article-content-padded-inner .meta a:after { content: ' →'; font-size: 0.9em; }

/* Blockquotes */
.article-content-padded-inner blockquote {
  margin: 2em auto; padding: 0.6em 1.6em; font-family: var(--font-body);
  font-size: 1.05em; line-height: 1.7; font-style: italic;
  border-left: 3px solid #ccc; background-color: #f9f9f9;
  max-width: 650px;
}
.article-content-padded-inner blockquote p:last-child { margin-bottom: 0; }

.article-content-padded-inner .large {
  font-size: 1.2em; line-height: 1.5; margin: 1.5em 0;
  font-family: var(--font-small-caps);
  max-width: 700px; margin-left: auto; margin-right: auto;
}

/* Utility */
.media-check { display:none !important; }

/* Clearfix Mixin Equivalent (if not already defined) */
.menu ul, .menu li, article, .meta, .row {
  *zoom: 1; }
  .menu ul:before, .menu li:before, article:before, .meta:before, .row:before, .menu ul:after, .menu li:after, article:after, .meta:after, .row:after {
   display: table; }
  .menu ul:after, .menu li:after, article:after, .meta:after, .row:after {
    clear: both; }

/* Site Title (These are probably for the index page, not article. Keep them in style.css) */
.site-title,
.single-title,
.publication-title {
  font-family: "PxGroteskRegular", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 6.5vw; /* This is the base size for larger screens, but below 1300px */
  line-height: 1em;
  font-weight: 400;
  position: fixed;
  top: 50%;
  left: 50%;
  text-align: center;
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  width: 90vw;
  z-index: 102;
  letter-spacing: -0.05em;
  color: black;
  opacity: 0.9;
  z-index: 3;
  -moz-transition: colour 100ms, opacity 100ms;
  -ms-transition: colour 100ms, opacity 100ms;
  -webkit-transition: colour 100ms, opacity 100ms;
  transition: colour 100ms, opacity 100ms;
  -webkit-backface-visibility: hidden; }
  @media (min-width: 1300px) {
    .site-title,
    .single-title,
    .publication-title {
      font-family: "PxGroteskRegular", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-size: 84px;
      line-height: 1em; } }

/* Find this media query for smaller screens */
@media (max-width: 760px) {
    .site-title,
    .single-title,
    .publication-title {
        position: absolute;
        top: 44vh;
        left: 50% !important;          /* MODIFIED: Added !important */
        transform: translateX(-50%) !important; /* MODIFIED: Added !important */
        font-family: "PxGroteskRegular", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 6vw; /* Keep as is, your h1.main-site-title specific rule should override this */
        line-height: 1em;
    }
}

.single-title {
  z-index: -1;
  opacity: 0.03;
  display: none; }

.text-wrapper-expand:hover {
    text-decoration: none;
}

/* This rule exists twice, but `gallery-nav` is scoped under `.article-content-padded-inner`
   for the arrows to function correctly. This global one might be redundant or for something else.
   Leaving it for now as it was in your original file.
*/
.gallery-nav {
    /* display: none; */ /* Comment this line out */
}

/* Ensure the article itself is the scrolling container and hide its scrollbar */
#project-ajax-content-area {
    /* You already have these, just ensuring they are understood: */
    /* position: fixed; */
    /* top: 0; left: 0; right: 0; */
    /* height: 100vh; */
    overflow-y: auto; /* Essential: allows content to scroll within the fixed 100vh height */

    /* Scrollbar hiding for IE/Edge */
    -ms-overflow-style: none;
    /* Scrollbar hiding for Firefox */
    scrollbar-width: none;
}

/* Scrollbar hiding for Webkit (Chrome, Safari, Opera) */
/* Target the scrollbar itself within the specific article */
#project-ajax-content-area::-webkit-scrollbar {
    display: none;
    width: 0; /* Sometimes needed for Webkit to completely remove its space */
    height: 0;
}

/* --- New Rules for supporting opticon.html content with dynamic colors --- */

/* These ensure elements that used to have hardcoded colors in opticon.html now use the dynamic highlight color */

#project-ajax-content-area .gallery {
    background: var(--dynamic-highlight-color); /* Gallery background color */
}

#project-ajax-content-area .gallery-image-bg {
      /* background-color: var(--dynamic-highlight-color);*/
}

#project-ajax-content-area .text-wrapper-expand {
    /* background-color: var(--dynamic-highlight-color);*/
    border-color: var(--dynamic-highlight-color);
    color: var(--dynamic-primary-text-color); /* Ensure text is readable on the highlight background */
    /* Add any other consistent styling for this element, e.g., padding, border-radius */
    display: block; /* Ensure it behaves as a block element */
    width: fit-content; /* Or a specific width */
    padding: 10px 20px; /* Example padding */
    text-align: center;
    text-decoration: none; /* Remove underline for links */
    cursor: pointer;
    transition: background-color 0.3s ease; /* Smooth transition */
}

#project-ajax-content-area .text-wrapper-expand:hover {
    filter: brightness(1.1); /* Slightly brighten on hover */
}

/* Ensure these text elements pick up the highlight color, if not already handled */
#project-ajax-content-area .large,
#project-ajax-content-area strong, /* This applies to all strong tags within the content area. Be mindful if only specific strong tags should be highlighted. */
#project-ajax-content-area .introduction,
#project-ajax-content-area .title,
#project-ajax-content-area .gallery-nav,
#project-ajax-content-area .caption {
    color: var(--dynamic-highlight-color);
}

/* Blockquote's border-left should already be using var(--dynamic-highlight-color) from previous steps. */

/* --- General consistency for content blocks within #project-ajax-content-area --- */
/* (Verify these are already present and apply correctly. Adjust if needed.) */

#project-ajax-content-area .block {
    margin-bottom: 20px; /* Standard spacing between blocks */
    /* Other common block styles */
}

#project-ajax-content-area .introduction p {
    font-size: 1.5em; /* Example for larger intro text */
    line-height: 1.4;
    font-weight: bold; /* Based on typical intro styles */
}

#project-ajax-content-area .text-block p {
    margin-bottom: 1em; /* Spacing between paragraphs */
}

#project-ajax-content-area a {
    color: var(--dynamic-highlight-color); /* Ensure links are highlighted */
    text-decoration: none;
    transition: color 0.3s ease;
}

#project-ajax-content-area a:hover {
    text-decoration: underline;
}

/* Specific styling for the gallery navigation arrows if needed */
#project-ajax-content-area .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);

    /* --- MODIFIED/ADDED FOR CENTERING & SIZING --- */
    width: 48px;             /* Explicit width for the circle */
    height: 48px;            /* Explicit height for the circle */
    border-radius: 50%;      /* Makes it a perfect circle */
    line-height: 48px;       /* Crucial: Matches height for perfect vertical centering */
    text-align: center;      /* Horizontally center the arrow */
    /* --- END MODIFIED/ADDED --- */

    font-size: 1.6em;          /* Keep your desired font size for the arrow icon */
    text-decoration: none;
    cursor: pointer;
    z-index: 10;
    display: block;          /* Keep this from your last fix */
    transition: background-color 0.2s, color 0.2s; /* Add transition for hover effect */
}

#project-ajax-content-area .gallery-nav.prev {
    left: 20px;
}

#project-ajax-content-area .gallery-nav.next {
    right: 20px;
}

#project-ajax-content-area .gallery-nav:hover {
    background: var(--dynamic-highlight-color); /* CHANGE THIS LINE */
    color: white; /* Keep the arrow itself white */
    text-decoration: none;
}

/* Ensure images within blocks are responsive */
#project-ajax-content-area .block img {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below images */
}

div.meta::before {
    content: none; /* This will remove any content inserted by ::before */
}

/* NEW MEDIA QUERY for iPhone 16 or smaller and similar very narrow screens */
@media (max-width: 420px) { /* This covers most modern phones (e.g., iPhone 16, 15, 14, etc.) */

    /* --- 1. Make the main article container full width --- */
    article.main-content-container#project-ajax-content-area {
        max-width: 100vw; /* Occupy full viewport width */
        margin: 0;       /* Remove auto margins, push to edges */
    }

    /* --- 2. Make the inner padded content full width and adjust padding --- */
    .article-content-padded-inner {
        max-width: 100%; /* Ensure it takes the full width of its parent (which is now 100vw) */
        margin: 0;       /* Remove auto margins */
        /* Adjust padding to maximize content. Fixed pixel values for horizontal are often best on mobile. */
        padding-left: 15px;  /* Example: 15px padding on left side */
        padding-right: 15px; /* Example: 15px padding on right side */
        /* You can keep vertical padding from your existing mobile rule, or make it fixed too: */
        padding-top: 20px; /* Example: Fixed top padding */
        padding-bottom: 20px; /* Example: Fixed bottom padding */
    }

    /* --- 3. Ensure all internal content blocks also go full width --- */
    /* Many content blocks like .introduction, .block, blockquote, .large, .meta have max-width: 700px; and margin: auto; */
    /* These also need to be overridden for full width display. */
    .article-content-padded-inner .introduction,
    .article-content-padded-inner .block,
    .article-content-padded-inner blockquote,
    .article-content-padded-inner .large,
    .article-content-padded-inner .meta {
        max-width: 100%; /* Remove max-width constraint */
        margin-left: 0;  /* Remove auto margins */
        margin-right: 0; /* Remove auto margins */
    }

    /* Adjust padding for blockquote if it looks too cramped when full width */
    .article-content-padded-inner blockquote {
        padding-left: 15px; /* Match main content padding */
        padding-right: 15px;
    }

    /* --- 4. Optional: Adjust font sizes if needed for optimal legibility --- */
    /* If your 'vw' based font sizes become too large or too small with full width,
       you can adjust them here for very narrow screens. */
    .article-content-padded-inner {
        font-size: 18px; /* Example: A fixed, comfortable font size for body copy */
        line-height: 1.6em;
    }
    .article-content-padded-inner .item-title h1 {
        font-size: 8vw; /* Example: Allow H1 to scale down more aggressively */
        /* You could use a clamp here for more control, e.g., font-size: clamp(2rem, 8vw, 3rem); */
    }
    .article-content-padded-inner h2 {
        font-size: 6vw; /* Example: Adjust for subheadings */
    }
    .article-content-padded-inner h3 {
        font-size: 5vw; /* Example: Adjust for sub-subheadings */
    }

    /* --- 5. Optional: Adjust gallery navigation arrows if they get too close to the edges --- */
    .article-content-padded-inner .gallery-nav.prev {
        left: 5px; /* Move closer to the left edge */
    }
    .article-content-padded-inner .gallery-nav.next {
        right: 5px; /* Move closer to the right edge */
    }
}
/* --- THE SCROLL LIBERATOR --- */

/* 1. Force the Body to be a static container so it doesn't fight the article */
body.single {
    overflow: hidden !important; /* Stop the background from scrolling */
    position: fixed;
    width: 100%;
}

/* 2. Make the Article the absolute Master of the screen */
body.single #project-ajax-content-area {
    display: block !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important; /* Above everything including the nav-cover */
    overflow-y: scroll !important; /* Enable vertical scroll */
    -webkit-overflow-scrolling: touch !important; /* Momentum for iOS */
    background: #fff; /* Ensure it's opaque */
    pointer-events: auto !important;
}

/* 3. Make the Nav-Cover a ghost so it can't steal touch events */
body.single .nav-cover {
    pointer-events: auto !important;
    z-index: 9998 !important; /* Just behind the article */
}

/* Restore clickable side-overlay close area on non-stacked pages (desktop/tablet). */
@media (min-width: 761px) {
    body.single #project-ajax-content-area.main-content-container:not(.stacked-layout) {
        left: 10vw !important;
        right: 10vw !important;
        width: auto !important;
    }
}

/* 4. Ensure the Menu Button is still clickable over the article */
.menu-link {
    z-index: 10000 !important;
    pointer-events: auto !important;
}
/* Ensure the menu button remains visible and on top, even during transitions */
.menu-link {
    z-index: 10000 !important; /* Keep it above the article (9000) */
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* If your close button disappears because of the 'single' class, force it back */
body.single .menu-link {
    opacity: 1 !important;
}
/* Force the Menu Button to show the 'Close' icon when an article is open */
/* Note: You may need to check if your template uses .active, .open, or .close-state */

body.single .menu-link {
    /* This forces the button to maintain its 'Open Menu' visual state 
       even if the .show-menu class is removed from the body */
}

/* EXAMPLE: If your theme uses a span or icon inside the button */
body.single .menu-link span {
    /* Add the CSS properties here that transform the lines into an X */
    /* Often this involves a rotation or background change */
}
/* FORCE THE MENU BUTTON TO STAY ON TOP */
.menu-link {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 20000 !important; /* Higher than the article (9000) */
}

/* On Mobile, ensure the container isn't hidden */
#header, .menu-link-container {
    z-index: 20001 !important;
}

/* If the button text/icon is disappearing, ensure it's not white-on-white 
   or being hidden by the .single class */
body.single .menu-link {
    color: inherit; /* Or your preferred contrast color */
}

/* --- STACKED PAGE WIDTH FIX --- */
article#project-ajax-content-area.stacked-layout {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Match single-slider page width on desktop/tablet for stacked multi-slider pages. */
@media (min-width: 761px) {
    body.single #project-ajax-content-area.main-content-container.stacked-layout {
        left: 10vw !important;
        right: 10vw !important;
        width: auto !important;
    }
}

/* Multi-slider pages: use one consistent top padding scale (same as single-slider pages). */
article#project-ajax-content-area.stacked-layout > .article-content-padded-inner:first-child {
    max-width: 1000px;
    margin: 0 auto !important;
    padding: clamp(30px, 5vh, 60px) clamp(20px, 5vw, 70px) !important;
}

article#project-ajax-content-area.stacked-layout > .article-content-padded-inner:first-child > .project-block:first-child,
article#project-ajax-content-area.stacked-layout > .article-content-padded-inner:first-child > .project-block:first-child > .gallery:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    article#project-ajax-content-area.stacked-layout > .article-content-padded-inner:first-child {
        padding: clamp(20px, 4vh, 40px) 24px !important;
    }
}

/* Final override: responsive, centered arrows for multi-gallery pages. */
#project-ajax-content-area .project-block .gallery .gallery-nav {
    width: 64px !important;
    height: 64px !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 0 !important;
}

@media (max-width: 1024px) {
    #project-ajax-content-area .project-block .gallery .gallery-nav {
        width: 52px !important;
        height: 52px !important;
        font-size: 1.6rem !important;
    }
}

@media (max-width: 760px) {
    #project-ajax-content-area .project-block .gallery .gallery-nav {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
    }
}

@media (max-width: 760px) {
    body.single #project-ajax-content-area.main-content-container:not(.stacked-layout) {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}
