/* "Join the P6 Community" popup (homepage). Behaviour is in subscribe.js. */

/* <dialog> is the browser's built in modal box. showModal() puts it on top of
   the page, traps keyboard focus inside it, and closes it on Esc.
   margin:auto re-centers it, since Tailwind's reset sets margin to 0. */
.sub-dialog{margin:auto;width:min(920px,calc(100% - 32px));max-width:none;max-height:calc(100% - 32px);padding:0;border:1px solid rgba(255,255,255,.12);background:#131313;color:#ece9e4;overflow:auto}
/* ::backdrop is the dimmed layer the browser draws behind a modal dialog. */
.sub-dialog::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(2px)}
.sub-dialog[open]{animation:sub-in .35s ease-out}
@keyframes sub-in{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.sub-dialog[open]{animation:none}}

.sub-inner{display:grid;grid-template-columns:1fr}
@media (min-width:768px){.sub-inner{grid-template-columns:1fr 1fr}}

.sub-panel{position:relative;padding:0 32px 40px;overflow:hidden}
/* Red racing stripes along the top, fading out downward like the reference. */
.sub-stripes{height:84px;margin:0 -32px 8px;background:repeating-linear-gradient(-60deg,#c23b2c 0 16px,transparent 16px 34px);-webkit-mask-image:linear-gradient(to bottom,#000 10%,transparent);mask-image:linear-gradient(to bottom,#000 10%,transparent)}
.sub-panel h2{font-size:clamp(32px,5vw,44px);line-height:1;text-align:center}
.sub-lede{margin:14px auto 28px;max-width:300px;text-align:center;font-size:15px;line-height:1.5;color:#a29e97}

.sub-form{display:flex;flex-direction:column;gap:14px}
.sub-form input{width:100%;background:#0c0c0d;border:1px solid rgba(255,255,255,.18);border-radius:2px;padding:14px 16px;color:#ece9e4;font-family:"Archivo",sans-serif;font-size:15px;outline:none;transition:border-color .15s ease}
.sub-form input::placeholder{color:#6b6f78}
/* First and last name share a row, except on narrow phones where they stack. */
.sub-row{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width:480px){.sub-row{grid-template-columns:1fr 1fr}}
.sub-form input:focus{border-color:#c23b2c}
/* Button and status line, matching the contact page's quote form. */
.sub-form .submit-btn{background:#c23b2c;color:#fff;border:none;border-radius:2px;padding:14px 32px;margin-top:6px;font-family:"Oswald",sans-serif;font-weight:600;font-size:14px;letter-spacing:.22em;text-transform:uppercase;cursor:pointer;transition:background-color .15s ease}
.sub-form .submit-btn:hover{background:#a6301f}
.sub-form .submit-btn:disabled{opacity:.6;cursor:default}
.sub-form .form-status{font-family:"Archivo",sans-serif;font-size:14px;line-height:1.5;color:#a29e97;min-height:1.2em;text-align:center}
.sub-form .form-status.error{color:#e0523f}
.sub-thanks{text-align:center;padding:24px 0}
.sub-thanks p{margin-top:10px;color:#a29e97;font-size:15px}

/* Photo side. On phones it becomes a short banner above the form. */
.sub-photo{position:relative;order:-1;height:160px;background:#0c0c0d}
@media (min-width:768px){.sub-photo{order:0;height:auto;min-height:540px}}
.sub-photo .sub-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.sub-photo::after{content:"";position:absolute;inset:0;background:linear-gradient(to bottom,rgba(12,12,13,.65),transparent 45%)}
.sub-photo .sub-logo{position:absolute;z-index:1;top:22px;left:50%;transform:translateX(-50%);height:34px;width:auto}
@media (min-width:768px){.sub-photo .sub-logo{top:40px;height:44px}}

.sub-close{position:absolute;z-index:2;top:10px;right:10px;width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:50%;background:rgba(12,12,13,.6);color:#fff;cursor:pointer;transition:background-color .15s ease}
.sub-close:hover{background:#c23b2c}
.sub-close svg{width:20px;height:20px}
/* Visually hidden but still read by screen readers (labels for the inputs). */
.sub-dialog .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
