:root {
    --grid-size: 40px; /* ~1cm visual spacing */
    --paper-color: #f8f9fb;
    --grid-line-color: rgba(0, 80, 200, 0.12);
    --grid-line-color-vert: rgba(0, 80, 200, 0.10);
}

/* Paper + grid background */
body {
    background:
        /* horizontal grid lines */
        repeating-linear-gradient(0deg,
            var(--grid-line-color),
            var(--grid-line-color) 1px,
            transparent 1px,
            transparent var(--grid-size)
        ),
        /* vertical grid lines */
        repeating-linear-gradient(90deg,
            var(--grid-line-color-vert),
            var(--grid-line-color-vert) 1px,
            transparent 1px,
            transparent var(--grid-size)
        ),
        linear-gradient(var(--paper-color), var(--paper-color));
    background-attachment: fixed;
}

/* Ensure content sits above the canvas when draw mode is off */
.center-content {
    position: relative;
    z-index: 1;
}

/* Drawing canvas and toolbar - Enhanced for Fabric.js */
.drawing-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    touch-action: none; /* prevent scrolling during drawing */
}

/* Fabric.js creates a wrapper div, so we need to style that too */
.canvas-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 0;
    pointer-events: none;
    touch-action: none;
}

body.draw-mode .drawing-canvas,
body.draw-mode .canvas-container {
    z-index: 1000; /* above content while drawing */
    pointer-events: auto;
}

body.draw-mode .drawing-canvas {
    cursor: crosshair;
}

/* Ensure Fabric.js upper canvas (the drawing layer) respects our styling */
.upper-canvas {
    touch-action: none !important;
}

/* Fixed toolbar - top-right positioning */
.toolbar {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 1001;
    display: flex;
    gap: 12px;
    background: none;
    padding: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    /* No transform on hover - keep size consistent */
}

.tool-icon {
    width: 22px;
    height: 22px;
    transition: filter 0.2s ease;
    filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(174deg) brightness(96%) contrast(86%); /* darkgrey to match href links */
    max-width: 22px;
    max-height: 22px;
    display: block;
}

.icon-btn:hover .tool-icon {
    /* Keep same color on hover; only active state should be black */
    /* No scale transform - keep size consistent */
}

/* Allow non-pen icons to turn black on hover */
.icon-btn:not([data-tool="pen"]):hover .tool-icon {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(7500%) hue-rotate(308deg) brightness(97%) contrast(106%);
}

.icon-btn.active .tool-icon {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(7500%) hue-rotate(308deg) brightness(97%) contrast(106%); /* black when active */
    /* No scale transform - keep size consistent */
}
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {

    .center-content {
        margin: auto;
        margin-top: 1%;
        width: 90%;
        height: 100%;
        padding: 2px;
        font-family: 'Tinos', serif;
    }
    
    .left-content {
        margin:auto;
        width: 90%;
        height: 100%;
        font-family: 'Tinos', serif;
        vertical-align: top; 
        padding-top: 0rem;
    }
    
    .right-content {
        margin:auto;
        width: 90%;
        height: 100%;
        font-family: 'Tinos', serif;
        vertical-align: top; 
        padding-top: 0rem;
        word-break: break-word;
    }
    
    
    ul {
        list-style-type: none;
        overflow: hidden;
    }
    
    li {
        float: left;
    }
    
    h1{
        margin: 0%;
        font-family: 'Tinos', serif;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }
    
    h3 {
        margin: 0%;
    }
      
    li {
        display: block;
        text-align: center;
        padding: 16px;
        text-decoration: none;
        font-size: larger;
      }
    
}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
    .center-content {
        margin: auto;
        margin-top: 2%;
        width: 90%;
        height: 100%;
        padding: 2em;
        font-family: 'Tinos', serif;
        font-weight: normal;
    }
    
    .left-content {
        margin:auto;
        width: 27%;
        height: 100%;
        font-family: 'Tinos', serif;
        font-weight: normal;
        display: inline-block;
        vertical-align: top; 
    }
    
    .right-content {
        margin:auto;
        width: 67%;
        height: 100%;
        font-family: 'Tinos', serif;
        display: inline-block;
        vertical-align: top; 
        padding-left: 5%;
        word-break: break-word;
    }
    
    
    ul {
        list-style-type: none;
        display:inline;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    li {
        float: left;
    }
    
    h1{
        margin: 0%;
        font-family: 'Tinos', serif;
    }
    
    h3 {
        margin: 0%;
    }
      
    li {
        display: block;
        text-align: center;
        padding: 16px;
        text-decoration: none;
        font-size: larger;
      }
    
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {

    .center-content {
        margin: auto;
        margin-top: 2%;
        width: 75%;
        height: 100%;
        padding: 0px;
        font-family: 'Tinos', serif;
    }
    
    .left-content {
        margin:auto;
        width:27%;
        height: 100%;
        font-family: 'Tinos', serif;
        display: inline-block;
        vertical-align: top; 
    }
    
    .right-content {
        margin:auto;
        width: 67%;
        height: 100%;
        font-family: 'Tinos', serif;
        display: inline-block;
        vertical-align: top;
        word-break: break-word; 
        padding-left: 5%;
    }
    
    
    ul {
        list-style-type: none;
        display:inline;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    li {
        float: left;
    }
    
    h1{
        margin: 0%;
        font-family: 'Tinos', serif;
    }
    
    h2 {
        margin: 0%;
    }
      
    li {
        display: block;
        text-align: center;
        padding: 16px;
        text-decoration: none;
        font-size: larger;
      }
    
    .spacer {
        height: 15vh;
    }
    
}

img {
    width: 95%;
    margin:auto;
    display: block;
    border-radius: 50%;
}

.squire-logo {
    display: inline-block;
    height: 0.9em;
    width: auto;
    margin: 0 0.1em;
    padding: 0;
    border-radius: 0;
}

p {
    font-weight: 100;
    font-size: 1.1rem;
}

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

a:hover {
    color: black;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    margin: 0.2em 0;
    padding: 0;
    border-style: solid;
    border-color: black;
    background-color: black;
  }

