@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Manrope:wght@200..800&display=swap');


:root {

    /* =========================
       TYPOGRAPHY
    ========================= */

    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 2rem;
    --fs-4xl: 2.75rem;
    --fs-5xl: 3.5rem;


    /* =========================
       BRAND COLOURS
    ========================= */

    /* Main text */
    --text: #2C2C2C;

    /* Main website background */
    --background: #F8F7F4;

    /* Cards, nav, white sections */
    --surface: #FFFFFF;

    /* Main brand colour - sage */
    --primary: #879486;

    /* Beige accent */
    --accent: #D8C3A5;


    /* =========================
       COLOUR SHADES
       Useful for hover states,
       borders, backgrounds
    ========================= */


    /* Text shades */
    --text-light: #666666;
    --text-muted: #8A8A8A;


    /* Background shades */
    --background-dark: #EFEDE8;
    --background-light: #FCFBF9;


    /* Sage shades */
    --primary-dark: #6F7C6E;
    --primary-light: #AAB5A8;


    /* Beige shades */
    --accent-dark: #BFA98A;
    --accent-light: #E9DCC7;


    /* Borders */
    --border-color: #E8E5DF;
    --border-dark: #D6D1C8;
    --border: 1px solid var(--border-color);


    /* Status colours */

    /* Success */
    --success: #7C9A6D;

    /* Warning */
    --warning: #D6A85F;

    /* Error */
    --error: #B86B6B;

    /* Info */
    --info: #718A9A;

    /* =========================
       RADIUS
    ========================= */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* =========================
       SHADOWS
    ========================= */

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .05);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, .08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, .12);

    /* =========================
       SPACING
    ========================= */

    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;

    /* =========================
       LAYOUT
    ========================= */

    --container: 1280px;
    --section-pad: 5rem 0;
    --hero-pad: 8rem 0;

    /* =========================
       ANIMATION
    ========================= */

    --hover: translateY(-4px);
    --transition: .25s ease;
}



* {
    box-sizing: border-box;
}



html {
    scroll-behavior: smooth;
}

html, body {
   margin: 0;
   padding: 0;
   width: 100%;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--background);
}

body[data-required-role] > main,
body[data-required-role] > header,
body[data-required-role] > footer { visibility: hidden; }
body[data-auth-ready] > main,
body[data-auth-ready] > header,
body[data-auth-ready] > footer,
body.auth-error > main,
body.auth-error > header,
body.auth-error > footer { visibility: visible; }

h1,h2,h3,h4,h5,h6 { font-family: "Manrope", sans-serif; line-height: 1.15; text-wrap: balance; }
p { line-height: 1.65; }
button,input,textarea,select { font: inherit; }
:focus-visible { outline: 3px solid rgba(111,124,110,.45); outline-offset: 3px; }
[hidden] { display: none !important; }



img {
    max-width: 100%;
    display: block;

}

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

.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;left:1rem;top:-5rem;z-index:10000;background:var(--text);color:#fff;padding:.75rem 1rem;border-radius:var(--radius-sm)}
.skip-link:focus{top:1rem}
.section-anchor{scroll-margin-top:100px}
.responsive-table{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.responsive-table table{min-width:640px}
.inline-status,[role="status"],[role="alert"]{font-size:var(--fs-sm);line-height:1.5}
.inline-status:empty,[role="status"]:empty{display:none}
.empty-state{display:grid;justify-items:start;gap:var(--space-3);padding:var(--space-5);border:1px dashed var(--border-dark);border-radius:var(--radius-md);background:var(--background-light);color:var(--text-light)}
.empty-state p{margin:0}
.mc-toast-region{position:fixed;right:1rem;bottom:1rem;z-index:1000;display:grid;gap:.75rem;width:min(390px,calc(100vw - 2rem))}
.mc-toast{padding:1rem 1.1rem;border-radius:var(--radius-md);background:var(--text);color:#fff;box-shadow:var(--shadow-lg);animation:mc-toast-in .2s ease-out}
.mc-toast.success{background:#42634c}.mc-toast.error{background:#843f3f}.mc-toast p{margin:0}
@keyframes mc-toast-in{from{opacity:0;transform:translateY(8px)}}

@media(max-width:600px){:root{--section-pad:3.5rem 0;--hero-pad:5rem 0;--fs-5xl:2.5rem;--fs-4xl:2.15rem}.measurement-edit-row{grid-template-columns:1fr}.card-header-split{align-items:flex-start;flex-direction:column}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

.auth-error-banner{position:fixed;top:0;left:0;right:0;z-index:9999;padding:12px 16px;background:var(--error);color:#fff;text-align:center;font-size:var(--fs-sm)}

.content-empty-state,
.content-error,
.skeleton-placeholder {
    width: 100%;
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-light);
    color: var(--text-light);
    text-align: center;
}

.content-error { color: var(--error); }

.admin-form-grid,
.measurement-edit-row {
    display: grid;
    gap: var(--space-4);
}

.admin-form-grid label {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.measurement-edit-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: var(--space-3);
}

.dashboard-latest-render {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.legal-page,
.not-found-page { max-width: 58rem; padding-block: clamp(5rem, 10vw, 9rem); }
.legal-page section { padding-block: 1rem; border-bottom: var(--border); }
.legal-page h1,
.not-found-page h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); margin-bottom: 1rem; }
.not-found-page { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }

/* Dashboard readability and consistent page gutters */
.portal-main-content {
    box-sizing: border-box;
    max-width: 1500px;
    margin-inline: auto;
    padding: clamp(1.25rem, 4vw, 3.75rem) !important;
}
.portal-main-content > .section-anchor + .section-anchor,
.portal-main-content > .portal-card + .portal-card,
.portal-main-content > .section-anchor + .portal-card,
.portal-main-content > .portal-card + .section-anchor { margin-top: clamp(1.25rem, 3vw, 2rem); }
.portal-dashboard-grid { gap: clamp(1.25rem, 3vw, 2rem) !important; }
.portal-main-content .portal-card { padding: clamp(1.15rem, 2.5vw, 2rem); }
.portal-card > h2:first-child,
.portal-card-title-mini { font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.25; }
.portal-card p { max-width: 72ch; }
.mini-list-row-item,
.staff-job-list-row { gap: .9rem; text-decoration: none; }
.mini-list-row-item > span:first-child,
.staff-job-list-row > span:first-child { min-width: 0; display: grid; gap: .2rem; }
.mini-list-row-item small,
.staff-job-list-row small { color: var(--text-muted); overflow-wrap: anywhere; }
.admin-editor-card,
.portfolio-project-form { padding: clamp(1rem, 2vw, 1.5rem); border: var(--border); border-radius: var(--radius-md); background: var(--background-light); }
.admin-editor-card + .admin-editor-card,
.portfolio-project-form + .portfolio-project-form { margin-top: 1rem; }
.dashboard-subsection { margin-top: 2rem; padding-top: 1.5rem; border-top: var(--border); }
.dashboard-subsection > .card-header-split { margin-bottom: 1rem; }
.dashboard-subsection h3 { margin: 0 0 .25rem; font-size: var(--fs-lg); }
.dashboard-subsection p { margin: 0; color: var(--text-muted); }
.staff-portfolio-form { margin-top: 1rem; padding: 1rem; border: var(--border); border-radius: var(--radius-md); background: var(--background-light); }
.staff-portfolio-form .btn { align-self: end; }
.media-picker-field { display: grid; gap: .45rem; padding: .8rem; border: 1px dashed var(--border-color); border-radius: var(--radius-md); background: var(--surface); }
.dashboard-editor-details { margin-top: 1rem; border: var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: clip; }
.dashboard-editor-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.15rem; cursor: pointer; list-style: none; background: var(--background-light); }
.dashboard-editor-details > summary::-webkit-details-marker { display: none; }
.dashboard-editor-details > summary::after { content: "+"; font-size: 1.35rem; font-weight: 800; }
.dashboard-editor-details[open] > summary::after { content: "−"; }
.dashboard-editor-details > summary span { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); }
.dashboard-editor-details > form,
.dashboard-editor-details > .gallery-image-form,
.dashboard-editor-details > .mini-list-row-item { margin: 0; padding: 1rem 1.15rem; }

/* Clear file selection and upload states */
.file-selection-state { display: block; margin-top: .45rem; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.35; overflow-wrap: anywhere; }
.file-selection-state[data-state="selected"] { color: var(--primary-dark); font-weight: 700; }
.file-selection-state[data-state="uploading"] { color: var(--info); font-weight: 700; }
.file-selection-state[data-state="uploaded"] { color: var(--success); font-weight: 800; }
.file-selection-state[data-state="error"] { color: var(--error); font-weight: 700; }

#documents > .mini-list-row-item {
    margin-top: .75rem;
    padding: 1rem;
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--background-light);
    color: var(--text);
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
#documents > .mini-list-row-item:hover { border-color: var(--primary); background: var(--surface); transform: translateY(-1px); }
#documents > .mini-list-row-item > span:last-child { display: inline-flex; justify-content: center; padding: .55rem .85rem; border-radius: var(--radius-pill); background: var(--primary); color: #fff; font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }

@media (max-width: 620px) {
    .portal-main-content { padding-inline: 1rem !important; }
    .card-header-split,
    .mini-list-row-item { align-items: flex-start; flex-direction: column; }
    #documents > .mini-list-row-item > span:last-child { width: 100%; }
}
