/* Client account area - Evagoras Mandrides Photography */

:root {
    --paper: #faf8f5;
    --paper-alt: #f1ede7;
    --ink: #211d1a;
    --bronze: #8a6f4d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.6;
}

h1, h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5rem;
}

a { color: var(--bronze); }

.btn {
    display: inline-block;
    background: #3a7a3a;
    color: #fff;
    text-decoration: none;
    border: none;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    font-family: 'Outfit', sans-serif;
    font-size: .95rem;
    cursor: pointer;
}
.btn:hover { background: #2d602d; }
.btn-small { padding: .45rem 1rem; font-size: .85rem; }
.btn-quiet {
    color: var(--ink);
    text-decoration: none;
    font-size: .95rem;
    padding: .4rem .8rem;
}
.btn-quiet:hover { color: var(--bronze); }

.notice {
    background: #f6e7e2;
    border-left: 3px solid #b0563a;
    padding: .7rem 1rem;
    font-size: .95rem;
}
.notice-good { background: #e9efe4; border-left-color: #5a7a4a; }

.empty { color: #6b6259; }

/* ---- Auth pages ---- */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--paper-alt);
}
.auth-card {
    background: var(--paper);
    max-width: 420px;
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: 6px;
    box-shadow: 0 2px 24px rgba(33, 29, 26, .08);
    text-align: center;
}
.auth-logo { height: 42px; margin-bottom: 1.5rem; }
.auth-intro { margin-top: 0; color: #6b6259; }
.auth-card form { text-align: left; margin-top: 1.5rem; }
.auth-card label {
    display: block;
    font-size: .9rem;
    font-weight: 400;
    margin-bottom: 1rem;
}
.auth-card .hint { color: #9a9088; font-weight: 300; }
.auth-card input {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .65rem .8rem;
    font: inherit;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
.auth-card input:focus {
    outline: 2px solid var(--bronze);
    outline-offset: 1px;
    border-color: var(--bronze);
}
.auth-card form button {
    width: 100%;
    margin-top: .5rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: .75rem;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}
.auth-card form button:hover { background: var(--bronze); }
.auth-switch { font-size: .9rem; margin-top: 1.5rem; }

/* ---- Account header ---- */

.acct-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid #e6e0d7;
}
.acct-header img { height: 42px; display: block; }
.acct-header nav { display: flex; align-items: center; gap: .5rem; }
.acct-user { font-size: .95rem; color: #6b6259; }

.acct-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ---- Dashboard ---- */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.album-card {
    display: block;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 1px 10px rgba(33, 29, 26, .07);
}
.album-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}
.album-meta { padding: .9rem 1rem 1.1rem; }
.album-meta h2 { font-size: 1.15rem; }
.album-meta p { margin: 0; font-size: .88rem; color: #6b6259; }

.add-code { margin-top: 3rem; }
.add-code h2 { font-size: 1.15rem; }
.add-code form { display: flex; gap: .6rem; max-width: 420px; }
.add-code input {
    flex: 1;
    padding: .65rem .8rem;
    font: inherit;
    border: 1px solid #d8d2c9;
    border-radius: 999px;
    background: #fff;
}
.add-code button {
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: .65rem 1.3rem;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}
.add-code button:hover { background: var(--bronze); }

/* ---- Gallery ---- */

.gallery-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.gallery-sub { margin: 0; color: #6b6259; font-size: .95rem; }

/* Justified grid: rows fill left-to-right, images keep their natural
   orientation uncropped. flex-grow/basis proportional to aspect ratio
   makes every image in a row the same height. */
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.photo-grid::after {
    content: '';
    flex-grow: 1000000; /* stops the last row stretching to fill */
}
.photo {
    position: relative;
    margin: 0;
    flex-grow: calc(var(--ar, 1.5) * 100);
    flex-basis: calc(var(--ar, 1.5) * 13rem);
}
.photo-open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: var(--paper-alt);
    cursor: pointer;
}
.photo-open img {
    width: 100%;
    height: auto;
    aspect-ratio: var(--ar, 1.5);
    display: block;
}

/* Overlay icons: heart bottom-left, cart bottom-right, bare icons no background */
.ph-fav, .ph-cart {
    position: absolute;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity .15s;
}
.ph-fav { bottom: 6px; left: 6px; }
.ph-cart { bottom: 6px; right: 6px; }
.ph-fav svg, .lb-fav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: rgba(255, 255, 255, .75);
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
    transition: stroke .15s, fill .15s;
}
.ph-cart svg {
    width: 22px;
    height: 22px;
    fill: rgba(255, 255, 255, .75);
    stroke: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
    transition: fill .15s;
}
.ph-fav:hover svg { stroke: #e57373; }
.ph-cart:hover svg { fill: #c9a06a; }
.photo:hover .ph-fav, .photo:hover .ph-cart,
.ph-fav:focus, .ph-cart:focus { opacity: 1; }
.photo.faved .ph-fav { opacity: 1; }
.photo.faved .ph-fav svg { fill: #e0393f; stroke: #e0393f; }
.photo.incart .ph-cart { opacity: 1; }
@media (hover: none) {
    .ph-fav, .ph-cart { opacity: 1; }
}

/* ---- Lightbox ---- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 17, 15, .96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 110px);
    object-fit: contain;
}
.lb-close, .lb-prev, .lb-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 2.2rem;
    line-height: 1;
    padding: .5rem .8rem;
    opacity: .8;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-close { top: .5rem; right: .75rem; }
.lb-prev { left: .25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .25rem; top: 50%; transform: translateY(-50%); }
.lb-bar {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    color: #cfc8bf;
    font-size: .9rem;
}
.lb-bar .btn { background: var(--bronze); color: #fff; }
.lb-bar .btn:hover { background: #a3835c; }

/* Heart in the lightbox bar */
.lb-fav {
    background: none;
    border: none;
    cursor: pointer;
    padding: .3rem;
    display: flex;
    align-items: center;
}
.lb-fav svg { width: 24px; height: 24px; }
.lb-fav:hover svg { stroke: #e57373; }
.lb-fav.faved svg { fill: #e0393f; stroke: #e0393f; }

/* Header floats over the gallery: visible when still, hidden while scrolling */
.acct-header--float {
    position: sticky;
    top: 0;
    z-index: 60;
    transition: transform .25s ease;
}
.acct-header--float.scrolling { transform: translateY(-100%); }

/* Touch screens: no prev/next arrows, flick up/down instead */
@media (hover: none) and (pointer: coarse) {
    .lb-prev, .lb-next { display: none; }
}

/* Favourites view: send panel */
.fav-send {
    background: var(--paper-alt);
    border-left: 3px solid var(--bronze);
    padding: 1rem 1.2rem;
    margin: 2.5rem 0 1.25rem;
    max-width: 640px;
}
.fav-send p:first-child { margin-top: 0; }
.fav-send textarea {
    display: block;
    width: 100%;
    font: inherit;
    padding: .6rem .8rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
    margin-bottom: .8rem;
    resize: vertical;
    box-sizing: border-box;
}
.fav-send textarea:focus { outline: 2px solid var(--bronze); outline-offset: 1px; }
.mail-preview {
    background: #fff;
    border: 1px dashed #d8d2c9;
    padding: .8rem;
    font-size: .78rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: .8rem;
}
.nav-on { color: var(--bronze); font-weight: 400; }

@media (max-width: 600px) {
    .acct-main { padding: 1.25rem 1rem 3rem; }
    .photo { flex-basis: calc(var(--ar, 1.5) * 7.5rem); }
    .photo-grid { gap: 4px; }
    .auth-card { padding: 2rem 1.25rem; }
}
